tryCatch({
fpath <- paste0(tempdir(),"/15012016HD.csv")
download.file("https://rsleep.org/data/15012016HD.csv",fpath, method="curl")
events <- read_events_noxturnal(fpath)
unlink(fpath)
hypnogram(events)
}, error = function(e) {
print("Error executing this example, check your internet connection.")
})
Run the code above in your browser using DataLab