Learn R Programming

MIMS-unit algorithm

Please create github issues if you have any question related to the package. Please click the following button to subscribe to any update on the package (Very important to receive notifications about bugs and bug fixes).

Watch

Short introduction

MIMS-unit is abbreviated for Monitor Independent Movement Summary unit. This measurement is developed to harmonize the processing of accelerometer data from different devices. You may refer to the manuscript for the detail description of the algorithm.

Copyright and citation

The copyright of the work belongs to Northeastern University, mHealth Research Group. Please kindly cite the manuscript if you have used the package or referred to the algorithm in your work.

Shiny Demo App

You may try to compute MIMS-unit values using our shiny demo app https://qutang.shinyapps.io/MIMSunit/. Note that the upload file size limit is 50 MB. The usage quote for the server is limited, so we do not guarantee the web app is always available to you.

Datasets

All datasets used in the manuscript are available at https://mhealthgroup.github.io/MIMSunit/articles/datasets.html.

System Requirements

  1. R (>= 3.6.0)
  2. memory (> 4GB)

For Windows

Rtools >=3.5 (see: https://cran.r-project.org/bin/windows/Rtools/)

For Linux (use ubuntu as an example)

Install dependency system packages for devtools: build-essential, libcurl4-gnutls-dev, libxml2-dev, libssl-dev, libcurl4-ssl-dev.

Installation

Stable version

CRAN

install.packages('MIMSunit')

Development version

Github

install.packages("devtools")
devtools::install_github("mhealthgroup/MIMSunit")

Note: It is recommended to use Rstudio when installing the package, because devtools has some compatible issues with R command line interface.

Usage

MIMSunit::mims_unit(input_dataframe, dynamic_range=c(-3,3), epoch='1 min')

Assume the input dataframe is in following format, with the first column (timestamp) in POSXlct objects and the device used to collect this data has dynamic range being -3g to 3g. You may set the epoch length to be 1 min, 1 sec, 5 sec, 10 sec and so on.

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

Copy Link

Version

Install

install.packages('MIMSunit')

Monthly Downloads

225

Version

0.11.2

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Qu Tang

Last Published

June 21st, 2022

Functions in MIMSunit (0.11.2)

aggregate_for_orientation

Aggregate over epoch to get estimated accelerometer orientation.
cut_off_signal

Cut off input multi-channel signal according to a new dynamic range
cv_different_algorithms

Coefficient of variation values for different acceleration data summary algorithms
conceptual_diagram_data

The input accelerometer data used to generate the conceptual diagram (Figure 1) in the manuscript.
aggregate_for_mims

Aggregate over epoch to get numerically integrated values.
bandlimited_interp

Apply a bandlimited interpolation filter to the signal to change the sampling rate
custom_mims_unit

Compute both MIMS-unit and sensor orientations with custom settings
compute_orientation

Estimate the accelerometer orientation
clip_data

Clip dataframe to the given start and stop time
edge_case

A short snippet of raw accelerometer signal from a device that has ending data maxed out.
export_to_actilife

Export accelerometer data in Actilife RAW CSV format
generate_interactive_plot

Plot MIMS unit values or raw signal using dygraphs interactive plotting library.
extrapolate_rate

Get extrapolation rate.
import_actigraph_csv

Import raw multi-channel accelerometer data stored in Actigraph raw csv format
import_actigraph_csv_chunked

Import large raw multi-channel accelerometer data stored in Actigraph raw csv format in chunks
import_actigraph_count_csv

Import Actigraph count data stored in Actigraph summary csv format
rest_on_table

A short snippet of raw accelerometer signal from a device resting on a table.
illustrate_signal

Plot given raw signal in illustration diagram style.
parse_epoch_string

Parse epoch string to the corresponding number of samples it represents.
extrapolate

Extrapolate input multi-channel accelerometer data
illustrate_extrapolation

Plot illustrations about extrapolation in illustration style.
interpolate_signal

Interpolate missing points and unify sampling rate for multi-channel signal
iir

Apply IIR filter to the signal
import_mhealth_csv_chunked

Import large raw multi-channel accelerometer data stored in mHealth Specification in chunks.
sum_up

Sum of multi-channel signal.
import_enmo_csv

Import ENMO data stored in csv csv
segment_data

Segment input dataframe into windows as specified by breaks. segment_data segments the input sensor dataframe into epoch windows with length specified in breaks.
import_mhealth_csv

Import raw multi-channel accelerometer data stored in mHealth Specification
vector_magnitude

Vector magnitude of multi-channel signal.
import_activpal3_csv

Import raw multi-channel accelerometer data stored in ActivPal3 csv format
import_actigraph_meta

Import The meta information stored in Actigraph RAW or summary csv file.
sample_raw_accel_data

Sample raw accelerometer data
sampling_rate

Estimate sampling rate for multi-channel signal
sensor_orientations

Estimates sensor orientation
shiny_app

Run shiny app to compute MIMSunit values from files
measurements_different_devices

The mean and standard deviation of accelerometer summary measure for different acceleration data summary algorithms and for different devices.
simulate_new_data

Simulate new data based on the given multi-channel accelerometer data
mims_unit

Compute Monitor Independent Motion Summary unit (MIMS-unit)