data-raw/SWA/sample_code/sample_code.R

# THIS FILE CONTAINS SAMPLE CODE FOR PROCESSING A SINGLE ARMBAND FILE, STARTING
# FROM THE FORMAT SHOWN IN `SAMPLE_FILE.XLS`

## Setup ####

  rm(list = ls()) # Clear memory
  library(magrittr) # Attach magrittr package (makes code more readable)
  devtools::load_all() # Load functions etc. from the FLAS package

## Run the code ####

  path_to_file <- "data-raw/SWA/sample_code/sample_file.xls"

  swa <-
    get_id(path_to_file) %>%
    list(id = ., file = path_to_file) %>%
    swa_process(.)

## Optional -- view the data

  head(swa)
  View(swa)

## Optional -- save the data

  saveRDS(swa, "data-raw/SWA/sample_code/sample_output.rds")

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