R/swa_process.R

Defines functions swa_process

Documented in swa_process

#' Processing function for armband files
#'
#' @param info list containing \code{file} and \code{id} elements
#' @param track data frame with data tracking information
#'
#' @keywords internal
swa_process <- function(info) {

  info$file %>%
  swa_read("Data") %>%
  add_id(info$id) %>%
  swa_check_variables(.) %>%
  swa_get_time(.) %>%
  swa_get_intensity(.) %>%
  {stats::setNames(
    ., paste("SWA", names(.), sep = "_")
  )} %>%
  {stats::setNames(
    ., gsub("\\.+", "_", names(.))
  )} %>%
  {stats::setNames(
    ., gsub("SWA_id", "id", names(.))
  )} %>%
  {structure(., row.names = seq(nrow(.)))}

}
PAHPLabResearch/FLASH documentation built on May 15, 2020, 7:08 p.m.