#get the example file from within the package
path <- system.file("extdata/",
package = "LightLogR")
file.sleep <- "205_sleepdiary_all_20230904.csv"
#import Data in the wide format (sleep/wake times)
import_Statechanges(file.sleep, path,
Datetime.format = "dmyHM",
State.colnames = c("sleep", "offset"),
State.encoding = c("sleep", "wake"),
Id.colname = record_id,
sep = ";",
dec = ",")
#import in the long format (Comments on sleep)
import_Statechanges(file.sleep, path,
Datetime.format = "dmyHM",
State.colnames = "comments",
Datetime.column = sleep,
Id.colname = record_id,
sep = ";",
dec = ",", structure = "long")
Run the code above in your browser using DataLab