The goal of Kumbogram is to spit out sleep macro architecture parameters from hypnogram file
You can install the development version of Kumbogram from GitHub with:
# install.packages("devtools")
devtools::install_github("rahulvenugopal/Kumbogram")
This is a basic example which shows you how to use the function:
library(Kumbogram)
library(reader)
filename = 'data_full_6hrs_100Hz_hypno_30s.txt'
hypnogram_file <- n.readLines(paste(filename, sep = "\n"),
header = FALSE,
n=720)
sleep_data <- fetch_sleep_parametres(hypnogram_file = hypnogram_file,
epoch_duration = 30)
- Gather sleep architecture related parameters from a scored hypnogram file
fetch_sleep_params
functions extracts 32
sleep variables
- Wake_duration
- N1_duration
- N2_duration
- N3_duration
- R_duration
- Wake_percentage
- N1_percentage
- N2_percentage
- N3_percentage
- R_percentage,
- sleep_efficiency
- Wake_onset
- N1_onset
- N2_onset
- N3_onset
- R_onset
- TST
- W_longest_streak
- N1_longest_streak
- N2_longest_streak
- N3_longest_streak
- R_longest_streak
- W_mean_length_of_streak
- N1_mean_length_of_streak
- N2_mean_length_of_streak
- N3_mean_length_of_streak
- R_mean_length_of_streak
- W_median_length_of_streak
- N1_median_length_of_streak
- N2_median_length_of_streak
- N3_median_length_of_streak
- R_median_length_of_streak