Learn R Programming

⚠️There's a newer version (0.11.2) of this package.Take me there.

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

243

Version

0.10.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Qu Tang

Last Published

April 29th, 2021

Functions in MIMSunit (0.10.0)

custom_mims_unit

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

Aggregate over epoch to get estimated accelerometer orientation.
aggregate_for_mims

Aggregate over epoch to get numerically integrated values.
cv_different_algorithms

Coefficient of variation values for different acceleration data summary algorithms
cut_off_signal

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

Clip dataframe to the given start and stop time
compute_orientation

Estimate the accelerometer orientation
conceptual_diagram_data

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

Extrapolate input multi-channel accelerometer data
illustrate_extrapolation

Plot illustrations about extrapolation in illustration style.
import_actigraph_count_csv

Import Actigraph count data stored in Actigraph summary csv format
extrapolate_rate

Get extrapolation rate.
export_to_actilife

Export accelerometer data in Actilife RAW CSV format
edge_case

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

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

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

Import raw multi-channel accelerometer data stored in ActivPal3 csv format
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_actigraph_csv

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

Import ENMO data stored in csv csv
illustrate_signal

Plot given raw signal in illustration diagram style.
import_actigraph_csv_chunked

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

Vector magnitude of multi-channel signal.
sum_up

Sum of multi-channel signal.
bandlimited_interp

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

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

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

Apply IIR filter to the signal
bessel

Apply Bessel lowpass filter to the signal
import_actigraph_meta

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

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

Compute Monitor Independent Motion Summary unit (MIMS-unit)
measurements_different_devices

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

Remove constant component of the signal
sensor_orientations

Estimates sensor orientation
shiny_app

Run shiny app to compute MIMSunit values from files
simulate_new_data

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

Estimate sampling rate for multi-channel signal
sample_raw_accel_data

Sample raw accelerometer data
rest_on_table

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