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.11.1

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Qu Tang

Last Published

November 20th, 2021

Functions in MIMSunit (0.11.1)

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
bessel

Apply Bessel lowpass filter to the signal
compute_orientation

Estimate the accelerometer orientation
aggregate_for_mims

Aggregate over epoch to get numerically integrated values.
custom_mims_unit

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

Aggregate over epoch to get estimated accelerometer orientation.
clip_data

Clip dataframe to the given start and stop time
bandlimited_interp

Apply a bandlimited interpolation filter to the signal to change the sampling rate
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
iir

Apply IIR filter to the signal
import_actigraph_count_csv

Import Actigraph count data stored in Actigraph summary csv format
parse_epoch_string

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

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

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

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

Remove constant component of the signal
rest_on_table

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

Plot illustrations about extrapolation in illustration style.
export_to_actilife

Export accelerometer data in Actilife RAW CSV format
sensor_orientations

Estimates sensor orientation
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.
illustrate_signal

Plot given raw signal in illustration diagram style.
import_enmo_csv

Import ENMO data stored in csv csv
extrapolate_rate

Get extrapolation rate.
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
import_mhealth_csv

Import raw multi-channel accelerometer data stored in mHealth Specification
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
import_actigraph_csv

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

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

Sum of multi-channel signal.
interpolate_signal

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

Vector magnitude of multi-channel signal.
import_actigraph_csv_chunked

Import large raw multi-channel accelerometer data stored in Actigraph raw csv format in chunks
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