# THIS FILE CONTAINS SAMPLE CODE FOR PROCESSING A SINGLE PARTICIPANT'S ACT24
# DATA, HAVING THE FORMAT SHOWN IN `SAMPLE_FILE.CSV`
## Setup ####
rm(list = ls()) # Clear memory
library(magrittr) # Attach magrittr package (makes code more readable)
devtools::load_all() # Load functions etc. from FLASH package
## Run the code ####
path_to_file <- "data-raw/ACT24/sample_code/sample_file.csv"
events <-
data.table::fread(path_to_file, stringsAsFactors = FALSE) %>%
data.frame(stringsAsFactors = FALSE)
minutes <-
events %>%
act24_wrapper(.$UserName[1], ., TRUE)
## Optional -- view the data ####
head(events)
head(minutes)
View(events)
View(minutes)
## Optional -- save the data ####
saveRDS(
events,
"data-raw/ACT24/sample_code/sample_output_events.rds"
)
saveRDS(
minutes,
"data-raw/ACT24/sample_code/sample_output_60s.rds"
)
## Read back in
#
# events <- readRDS(
# "data-raw/ACT24/sample_code/sample_output_events.rds"
# )
# minutes <- readRDS(
# "data-raw/ACT24/sample_code/sample_output_60s.rds"
# )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.