inst/doc/Using_rsleep_and_SleepCycles_packages_to_detect_sleep_cycles.R

## ----env, include = FALSE-----------------------------------------------------
options(scipen=999)

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>")

## ----hypnogram, echo=FALSE, message=FALSE, warning=FALSE----------------------
library(rsleep)

if(!file.exists("15012016HD.csv")){
  download.file(
  url = "https://rsleep.org/data/15012016HD.csv",
  destfile = "15012016HD.csv",
  method="curl")}

events <- read_events_noxturnal("15012016HD.csv")

events = hypnogram(events)

plot_hypnogram(events)

Try the rsleep package in your browser

Any scripts or data that you put into this service are public.

rsleep documentation built on Nov. 6, 2023, 1:06 a.m.