Import and summarize GENEActiv bin data for manual classification.
getGENEAsegments(
testfile,
start = NULL,
end = NULL,
Use.Timestamps = FALSE,
radians = FALSE,
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.seg = FALSE,
plot.seg.outputfile = "Changepoint",
verbose = FALSE,
...
)
segmented data are returned
character vector stating path to a GENEActiv bin file, or a folder containing GENEActiv bin files.
Where to start reading observations.
Where to end reading observations.
To use timestamps as the start and end time values this has to be set to TRUE. (Default FALSE)
calculate degrees rotation in radians.
Default is (.Machine$sizeof.pointer >= 8). see mmap
for more details
single character string to be appended to the file name for saving the segmenation output (default '_segmentated').
The absolute or relative path to directory in which artifacts (plot and changes files) should be created, or NULL (default "GENEAclassification").
a vector constructed 'column.summary' or 'default'. See segmentation
for details.
named numeric vector of decimal places with which to
round summary columns. NULL
returns unrounded values.
The length 1 character vector 'default' applies default roundings:
Start.Time = 0,
Degrees.mean = 3,
Degrees.median = 3,
Degrees.var = 3,
Degrees.sd = 3,
Degrees.mad = 3,
Magnitude.mean = 3,
UpDown.mean = 3,
UpDown.median = 3,
UpDown.var = 3
UpDown.sd = 3,
UpDown.mad = 3,
Principal.Frequency.median = 3,
Principal.Frequency.mad = 3,
Principal.Frequency.ratio = 3,
Principal.Frequency.sumdiff = 3,
Principal.Frequency.meandiff = 3,
Principal.Frequency.abssumdiff = 3,
Principal.Frequency.sddiff = 3,
Light.mean = 0,
Light.max = 0,
Temp.mean = 1,
Temp.sumdiff = 3
Temp.meandiff = 3
Temp.abssumdiff = 3
Temp.sddiff = 3
Step.count = 0
Step.sd = 1
Step.mean = 0
Step.GENEAamplitude = 3
Step.GENEAwavelength = 3
Step.GENEAdistance = 3
This can be changed by using a named list. e.g decimalplaces = c(Start.Time = 2, Degrees.mean = 4).
single logical, should a smoothing filter from wave.filter
be applied? (default FALSE).
single character, the name of the wavelet to use for smoothing
when filter is TRUE. (default "haar") Passed to link[waveslim]{wave.filter}
.
single numeric, the level to which to smooth. Passed to link[waveslim]{wave.filter}
(default 8).
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).
single character, the penalty to use for changepoint detection. default ("SIC").
Value of the type 1 error required when penalty is "Asymptotic".
Default set as NULL and so equals pen.value1 if no input.
An integer number of seconds between 5 and 30 during which at most one changepoint may occur.
single numeric that defines the smallest changepoint initially found. Passed to cpt.var
as the variable minseglen
The sampling frequency of the data, in hertz, when calculating the step number. (default 100).
The order of the filter applied with respect to the butter or cheby options.
See cheby1
or butter
.
to pass to the filter in the step counting algorithm.
the decibel level that the cheby filter takes. See cheby1
.
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.
The hysteresis applied after zero crossing. (default 100mg)
Window size in seconds for STFT computation. Increased window size mean better frequency resolution, but poorer time resolution. Defaults to 10 seconds.
single logical, Creates a plot displaying the changepoint locations.
The name of the png file created that shows the change points on a positionals plots.
single logical should additional progress reporting be printed at the console? (default TRUE).
other arguments to be passed to dataImport
,
segmentation
and other functions with these functions.
The returned object can be interrogated with head
.
## 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"))
Run the code above in your browser using DataLab