MyNixOS website logo
Description
Generate Walk Bouts from GPS and Accelerometry Data
Process GPS and accelerometry data to generate walk bouts. A walk bout is a period of activity with accelerometer movement matching the patterns of walking with corresponding GPS measurements that confirm travel. The inputs of the 'walkboutr' package are individual-level accelerometry and GPS data. The outputs of the model are walk bouts with corresponding times, duration, and summary statistics on the sample population, which collapse all personally identifying information. These bouts can be used to measure walking both as an outcome of a change to the built environment or as a predictor of health outcomes such as a cardioprotective behavior. Kang B, Moudon AV, Hurvitz PM, Saelens BE (2017) <doi:10.1016/j.trd.2017.09.026>.

walkboutr

The goal of walkboutr is to process GPS and accelerometry data into walking bouts. walkboutr will either return the original dataset along with bout labels and categories, or a summarized and de-identified dataset that can be shared for collaboration.

Installation

You can install the development version of walkboutr from GitHub with:

# install.packages("devtools")
devtools::install_github("rwalkbout/walkboutr")

Basic Usage

Simulated sample data

This is an example of simulated data that could be processed by walkboutr. The GPS data contain the required columns: time, latitude, longitude, speed. The accelerometry data contain the required columns: time, accerometry counts. These data have no extra columns, do not contain NAs, and don’t contain negative speeds or accelerometry counts. All times are also in date-time format.

library(walkboutr)
# generate sample gps data:
gps_data <- generate_walking_in_seattle_gps_data() 
# generate sample accelerometry data:
accelerometry_counts <- make_full_day_bout_without_metadata() 

GPS data:

time latitude longitude speed
2012-04-07 00:00:30 47.60620 122.3321 3.3588907
2012-04-07 00:01:00 47.62163 122.3475 2.4004880
2012-04-07 00:01:30 47.63056 122.3565 0.6412646
2012-04-07 00:02:00 47.63372 122.3596 1.6616599
2012-04-07 00:02:30 47.63995 122.3659 2.0068013
2012-04-07 00:03:00 47.64775 122.3737 1.1009735
Accelerometry data:
activity_counts time
0 2012-04-07 00:00:30
0 2012-04-07 00:01:00
0 2012-04-07 00:01:30
0 2012-04-07 00:02:00
500 2012-04-07 00:02:30
500 2012-04-07 00:03:00

Now that we have sample data, we can look at how the walkboutr package works. There are two top level functions that will allow us to generate either (1) a dataset with bouts and bout categories with all of our original data included, or (2) a summary dataset that is completely de-identified and shareable for research purposes.

Walk bout dataset including original data

walk_bouts <- identify_walk_bouts_in_gps_and_accelerometry_data(gps_data,accelerometry_counts)
bout bout_category activity_counts time non_wearing complete_day latitude longitude speed
1 walk_bout 500 2012-04-07 00:03:00 FALSE TRUE 47.64775 122.3737 1.1009735
1 walk_bout 500 2012-04-07 00:05:00 FALSE TRUE 47.69056 122.4165 2.7901428
1 walk_bout 500 2012-04-07 00:07:00 FALSE TRUE 47.75155 122.4775 0.9801357
1 walk_bout 500 2012-04-07 00:05:30 FALSE TRUE 47.70371 122.4296 2.7249735
1 walk_bout 500 2012-04-07 00:06:00 FALSE TRUE 47.71635 122.4423 4.0867381
1 walk_bout 500 2012-04-07 00:06:30 FALSE TRUE 47.73631 122.4622 3.0513150

Summarized walk bout dataset

This dataset is a set of labelled bouts that are categorized (bout_category) and contains information on bout specific median speed (median_speed), the start time of the bout (bout_start), the duration of the bout (in minutes for computational ease, duration), and a flag for whether the bout came from a dataset with a complete day worth of data (complete_day).

summary <- summarize_walk_bouts(walk_bouts)
bout median_speed complete_day bout_start duration bout_category
1 2.736466 TRUE 2012-04-07 00:02:30 5.0 walk_bout
2 2.555720 TRUE 2012-04-07 00:09:30 4304.5 walk_bout

In this example, we have 2 bout(s), and each bout has a label. Bout 1 occurred on 2012.04.07 and has a complete day worth of data (complete_day = TRUE) and a start time of 00:02:30. This bout lasted 5 minutes, or 0.0833333 hours. The bout is a non-walk bout because the participant was moving too slowly for this walk to be considered walking.

For more information on bout categories and how these are assigned, please see the vignette titled Generate Walk Bouts.

Metadata

Version

0.6.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows