vignettes/mims_unit_from_files.Rmd
mims_unit_from_files.Rmd
HEADER_TIME_STAMP,X,Y,Z
2016-10-03 14:51:14.236,0.007,-0.005,0.984
2016-10-03 14:51:14.256,0.008,-0.007,0.981
2016-10-03 14:51:14.276,0.009,-0.006,0.978
2016-10-03 14:51:14.297,0.009,-0.007,0.984
2016-10-03 14:51:14.317,0.010,-0.010,0.982
2016-10-03 14:51:14.337,0.011,-0.010,0.982
Make sure file_type
is set to ‘mhealth’ and file_path
is put in a vector.
Compute MIMS-unit values
# test on a sample file shipped with the package
sample_filepath = system.file("extdata", 'mhealth.csv', package='MIMSunit')
mims = MIMSunit::mims_unit_from_files(c(sample_filepath),
epoch = '1 sec',
dynamic_range = c(-2, 2),
output_mims_per_axis = TRUE,
file_type = 'mhealth')
Plot MIMS-unit values
MIMSunit::generate_interactive_plot(mims, "MIMS-unit values", c(2,3,4,5))
Make sure file_type
is set to ‘mhealth’ and file_paths
are sorted in time.
Compute MIMS-unit values
# test on sample files shipped with the package
sample_file_paths = c(system.file('extdata', 'mhealth.csv', package='MIMSunit'),
system.file('extdata', 'mhealth1.csv', package='MIMSunit'))
mims = MIMSunit::mims_unit_from_files(sample_file_paths,
epoch = '1 sec',
dynamic_range = c(-8, 8),
output_mims_per_axis = TRUE,
file_type = 'mhealth')
Plot MIMS-unit values
MIMSunit::generate_interactive_plot(mims, "MIMS-unit values", c(2,3,4,5))
------------ Data File Created By ActiGraph GT3X+ ActiLife v6.13.3 Firmware v2.5.0 date format M/d/yyyy at 40 Hz Filter Normal -----------
Serial Number: CLE2B20130009
Start Time 11:27:00
Start Date 6/14/2018
Epoch Period (hh:mm:ss) 00:00:00
Download Time 15:16:42
Download Date 6/14/2018
Current Memory Address: 0
Current Battery Voltage: 4.21 Mode = 12
--------------------------------------------------
Timestamp,Accelerometer X,Accelerometer Y,Accelerometer Z
6/14/2018 11:27:00.000,0.026,-0.082,-0.979
6/14/2018 11:27:00.025,0.029,-0.082,-0.982
6/14/2018 11:27:00.050,0.023,-0.085,-0.979
6/14/2018 11:27:00.075,0.029,-0.076,-0.979
6/14/2018 11:27:00.100,0.032,-0.082,-0.982
6/14/2018 11:27:00.125,0.029,-0.076,-0.979
6/14/2018 11:27:00.150,0.029,-0.082,-0.979
6/14/2018 11:27:00.175,0.029,-0.076,-0.977
6/14/2018 11:27:00.200,0.029,-0.076,-0.979
6/14/2018 11:27:00.225,0.029,-0.082,-0.979
6/14/2018 11:27:00.250,0.029,-0.082,-0.982
Make sure file_type
is set to ‘actigraph’ and file_path
is put in a vector. Actigraph csv file may not include timestamps, so make sure set has_ts
to TRUE
.
Compute MIMS-unit values
# test with a sample file shipped with the package
sample_file_path = system.file('extdata', 'actigraph_timestamped.csv', package='MIMSunit')
mims = MIMSunit::mims_unit_from_files(c(sample_file_path),
epoch = '5 sec',
dynamic_range = c(-6, 6),
output_mims_per_axis = TRUE,
file_type = 'actigraph')
Plot MIMS-unit values
MIMSunit::generate_interactive_plot(mims, "MIMS-unit values", c(2,3,4,5))