data-raw/ActiGraph/sample_code/sample_code.R

# THIS FILE CONTAINS SAMPLE CODE FOR PROCESSING A SINGLE ACTIGRAPH FILE, OF THE
# FORMAT SHOWN IN `SAMPLE_FILE.CSV`

## Setup ####

  rm(list = ls()) # clear memory

## Run the code ####

  path_to_file <- "data-raw/ActiGraph/sample_code/sample_file.csv"

  AG <- AGread::read_AG_counts(
    file = path_to_file,
    verbose = TRUE,
    skip = 11
  )

  ## For applying the Choi algorithm, see the function in the file
  ## `R/AG_Nonwear.R`

## Optional -- view the data ####

  head(AG)
  View(AG)

## Optional -- save the data ####

  saveRDS(
    AG, "data-raw/ActiGraph/sample_code/sample_output.rds"
  )

  ## Read back in
  #
  # AG <- readRDS(
  #   "data-raw/ActiGraph/sample_code/sample_output.rds"
  # )
PAHPLabResearch/FLASH documentation built on May 15, 2020, 7:08 p.m.