gorkang / jsPsychHelpeR

https://gorkang.github.io/jsPsychR-manual/index.html
Other
2 stars 0 forks source link

Within variables #13

Open gorkang opened 2 years ago

gorkang commented 2 years ago

The column condition_within should be in the csv outputs when one or more within variables are used.

The within variables names stored in condition_within SHOULD be in camelCase separated by "_", so we can process them.

Examples:

When we find Bad names, a potential solution is something like this below, but it is slooooow because first splits each vector for each row, transforms to camelCase and finally pastes the strings together separated by "_":

DFX = DF_clean %>% filter(experimento == "FONDECYT") %>% select(trialid, condition_within) 

DFX %>% 
  rowwise() %>% 
  mutate(condition_within_camel = paste(map_chr(str_split(condition_within, pattern = "_", simplify = TRUE), janitor::make_clean_names, case = "small_camel"), collapse = "_"))

Maybe trigger this ONLY if we find spaces or "-" in the condition_within column?

gorkang commented 2 years ago

First implementation in create_raw_long(). IF it detects " " or "-", triggers a clean up.