getGENEAsegments {GENEAclassify} | R Documentation |
import and segment one or more bin files.
Description
Import and summarize GENEActiv bin data for manual classification.
Usage
getGENEAsegments(
testfile,
start = NULL,
end = NULL,
Use.Timestamps = FALSE,
radians = FALSE,
keep_raw_data = TRUE,
mmap.load = (.Machine$sizeof.pointer >= 8),
outputtoken = "_segmented",
outputdir = "GENEAclassification",
datacols = "default",
decimalplaces = "default",
filterWave = FALSE,
filtername = "haar",
j = 8,
changepoint = c("UpDownDegrees", "TempFreq", "UpDownFreq", "UpDownMean", "UpDownVar",
"UpDownMeanVar", "DegreesMean", "DegreesVar", "DegreesMeanVar",
"UpDownMeanVarDegreesMeanVar", "UpDownMeanVarMagMeanVar"),
penalty = "Manual",
pen.value1 = 40,
pen.value2 = 400,
intervalseconds = 30,
mininterval = 5,
samplefreq = 100,
filterorder = 2,
boundaries = c(0.5, 5),
Rp = 3,
plot.it = FALSE,
hysteresis = 0.1,
stft_win = 10,
plot_changepoints = FALSE,
plot_changepoints_outputfile = "Changepoint",
verbose = FALSE,
...
)
Arguments
testfile |
character vector stating path to a GENEActiv bin file, or a folder containing GENEActiv bin files. |
start |
Where to start reading observations. |
end |
Where to end reading observations. |
Use.Timestamps |
To use timestamps as the start and end time values this has to be set to TRUE. (Default FALSE) |
radians |
calculate degrees rotation in radians. |
keep_raw_data |
Keep the raw data for calculating steps using stepcounter. |
mmap.load |
Default is (.Machine$sizeof.pointer >= 8). see |
outputtoken |
single character string to be appended to the file name for saving the segmenation output (default '_segmentated'). |
outputdir |
The absolute or relative path to directory in which artifacts (plot and changes files) should be created, or NULL (default "GENEAclassification"). |
datacols |
a vector constructed 'column.summary' or 'default'. See |
decimalplaces |
named numeric vector of decimal places with which to
round summary columns.
This can be changed by using a named list. e.g decimalplaces = c(Start.Time = 2, Degrees.mean = 4). |
filterWave |
single logical, should a smoothing filter from |
filtername |
single character, the name of the wavelet to use for smoothing
when filter is TRUE. (default "haar") Passed to |
j |
single numeric, the level to which to smooth. Passed to |
changepoint |
defines the change point analysis to use. UpDownDegrees performs the change point analysis on the variance of arm elevation and wrist rotation. TempFreq performs a change point on the variance in the temperature and frequency (Typically better for sleep behaviours). |
penalty |
single character, the penalty to use for changepoint detection. default ("SIC"). |
pen.value1 |
Value of the type 1 error required when penalty is "Asymptotic". |
pen.value2 |
Default set as NULL and so equals pen.value1 if no input. |
intervalseconds |
An integer number of seconds between 5 and 30 during which at most one changepoint may occur. |
mininterval |
single numeric that defines the smallest changepoint initially found. Passed to |
samplefreq |
The sampling frequency of the data, in hertz, when calculating the step number. (default 100). |
filterorder |
The order of the filter applied with respect to the butter or cheby options.
See |
boundaries |
to pass to the filter in the step counting algorithm. |
Rp |
the decibel level that the cheby filter takes. See |
plot.it |
single logical, Creates a plot showing the zero crossings counted by the step counting algorithm#' @param Centre Centres the xz signal about 0 when set to True. |
hysteresis |
The hysteresis applied after zero crossing. (default 100mg) |
stft_win |
numeric for the window to calculate the frequency of an event using the |
plot_changepoints |
single logical, Creates a plot displaying the changepoint locations. |
plot_changepoints_outputfile |
The name of the png file created that shows the change points on a positionals plots. |
verbose |
single logical should additional progress reporting be printed at the console? (default TRUE). |
... |
other arguments to be passed to |
Value
segmented data are returned
See Also
The returned object can be interrogated with head
.
Examples
## testfile = file.path(system.file(package = "GENEAread"),
## "binfile",
## "TESTfile.bin")
##
## segData <- getGENEAsegments(testfile = testfile,
## outputdir = file.path(tempdir(), "GENEAclassification"),
## changepoint = "UpDownDegrees",
## pen.value1 = 1,
## pen.value2 = 1)
## head(segData)
## list.files(file.path(tempdir(), "GENEAclassification"))