This is a package aimed at converting .agd files from Actigraph into data.frames.
library("knitr")
library("devtools") install_github("masalmon/convertagd")
read_agd
is the function for reading a agd file and getting two tables out of it.
library("convertagd") file <- system.file("extdata", "dummyCHAI.agd", package = "convertagd") testRes <- read_agd(file, tz = "GMT") kable(testRes[["settings"]]) kable(head(testRes[["raw.data"]]))
Suppose you have a lot of agd files in one directory. You can convert all of them at the same time, outside of memory, using the batch_read_agd
function.
It takes the path to the directory as input and will save the results in the current working directory.
You will get two csv files for all agd files (all_in_one = TRUE
) :
settings.csv which is a table with 28 columns (the 28 settings names) and as many rows as there are agd files in the directory.
raw_data.csv which is a table with all measurements for all files, with a column "file_name" for identifying the individual sets of measurements.
This is how a call to the function looks like:
path_to_directory <- system.file("extdata", package = "convertagd") batch_read_agd(path_to_directory, tz="GMT")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.