om_parse_lifehacks: Parse LifeHacks

Description Usage Arguments Examples

View source: R/lifehacks.R

Description

Parse LifeHacks and make sure that they all make sense by checking them.

Usage

1
om_parse_lifehacks(cleaned_dat, OpenMindVersion = "Before 4.0")

Arguments

cleaned_dat

a dataset which includes LifeHacks to be parsed and checked

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## get key
key <- read_lines("../../Keys/airtabler.txt")

## download participant progress data
pp_dat <- om_download_at(key, tables = "ParticipantProgress")


## this parses all Lifehack data so far
parsed_lh <-  om_parse_lifehacks(pp_dat)


## if you just want the newest life hack data you can filter by OpenMind version
parsed_lh <-  pp_dat %>%
  ## making sure OpenMindVersion is numeric
  mutate(OpenMindVersion = as.numeric(OpenMindVersion)) %>%
  ## Only include OM Version 3 and above
  filter(OpenMindVersion >= 3) %>%
  ## parse Life hacks
  om_parse_lifehacks()

## just select the OMID and all LifeHack data (remove all other PP variables)
parsed_lh %>%
  select(OMID, LifeHack1:LifeHacksReason5)

openmindplatform/openmindR documentation built on Nov. 13, 2021, 2:13 p.m.