Description Usage Arguments Value Examples
View source: R/read_actigraphy.R
Read Actigraphy File
1 | read_actigraphy(file, ..., read_function = NULL)
|
file |
file to read |
... |
additional arguments to pass to function |
read_function |
A custom function to read the data in. |
An accelerometer object from the function used to read the file.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | url = paste0("https://github.com/THLfi/read.gt3x/files/",
"3522749/GT3X%2B.01.day.gt3x.zip")
destfile = tempfile(fileext = ".zip")
dl = utils::download.file(url, destfile = destfile)
gt3x_file = utils::unzip(destfile, exdir = tempdir())
gt3x_file = gt3x_file[!grepl("__MACOSX", gt3x_file)]
path = gt3x_file
res = read_actigraphy(path)
file = system.file("extdata",
"TAS1H30182785_2019-09-17.gt3x",
package = "SummarizedActigraphy")
res = read_actigraphy(file)
file = system.file("extdata",
"MECSLEEP17_left_wrist_012854_2013-12-09_11-37-24.bin.xz",
package = "SummarizedActigraphy")
res = read_actigraphy(file)
file = system.file("binfile", "ax3_testfile.cwa", package = "GGIR")
if (file.exists(file)) {
res = read_actigraphy(file)
}
file = system.file("binfile", "genea_testfile.bin", package = "GGIR")
if (file.exists(file)) {
res = read_actigraphy(file)
}
file = system.file("binfile", "GENEActiv_testfile.bin", package = "GGIR")
if (file.exists(file)) {
res = read_actigraphy(file)
}
file = "blah.exe"
testthat::expect_error(read_actigraphy(file))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.