The goal of Kumbogram is to spit out sleep macro architecture parameters from hypnogram file
Installation
You can install the development version of Kumbogram from GitHub with:
# install.packages("devtools")
devtools::install_github("rahulvenugopal/Kumbogram")
Example
This is a basic example which shows you how to use the function:
library(reader)
= 'data_full_6hrs_100Hz_hypno_30s.txt'
filename <- n.readLines(paste(filename, sep = "\n"),
hypnogram_file header = FALSE,
n=720)
<- fetch_sleep_parametres(hypnogram_file = hypnogram_file,
sleep_data epoch_duration = 30)
Kumbogram package has many useful functions to:
- Gather sleep architecture related parameters from a scored hypnogram file
fetch_sleep_params
functions extracts 32
sleep variables
Sleep stage durations, percentages and efficiency
- Wake_duration
- N1_duration
- N2_duration
- N3_duration
- R_duration
- Wake_percentage
- N1_percentage
- N2_percentage
- N3_percentage
- R_percentage,
- sleep_efficiency
Longest streak of each sleep stage by epochs count
- W_longest_streak
- N1_longest_streak
- N2_longest_streak
- N3_longest_streak
- R_longest_streak
Longest streak of each sleep stage by duration
- 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