gorkang / jspsychhelper Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://gorkang.github.io/jsPsychR-manual/index.html
License: Other
Home Page: https://gorkang.github.io/jsPsychR-manual/index.html
License: Other
We need to develop a few things to process Experimental tasks:
Example FONDECYT2022E1
create_targets_file(folder_data, and folder_tasks) can't be used from run_initial_setup
Review and adapt lines_DIRd
, function_DIRt
, names_dimensions
, etc.
If the experiment code is wrong, sometimes all the responses are coded the same.
Implement a CHECK to catch this.
Storing data files in a tar with gzip compression has some important advantages:
Drawbacks:
See initial implementation: dev/read_ZIP.R
bzip2: 5.91s | 1.9 Mb
gzip: 3.01s | 3 Mb
xz: 12.05s | 2 Mb
none: 3.37s | 41.3 Mb
In multi-select questions such as DEMOGR_19 Q0 remains in response if response empty.
Careful with create_clean_data changes, as they can easily interfere with separate_responses() resulting in errors in PRFBM_04 and similar items with multiple responses per screen.
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:
conditionOne_conditionTwo
conditionOne_condition number two
.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?
See new tasks in dev/ALL_PROTOCOLS.R
Updated on 2022-06-14:
Buscar manera de crear una sola prueba DEMOGR con TODAS las alternativas habitualmente usadas. Crear sistema para seleccionar subconjunto de preguntas.
Already have part of this in report_DF_clean (Details of tasks; Dimensions).
Include a section in each task correction script with a description of the task and of the dimensions. See prepare_IRI:
Avoid grepl in # Create long DIR chunk, as it can be ambiguous. Lots of tasks use this now.
Example:
Matches TASK_01, TASK_011, TASK_012...
Will cause issues when we generalize the use of 3 digit trialid's
A copy of the full protocol (jsPsychMaker) should be available zipped.
Maybe the run_initial_setup() could download not only the data but also the full protocol and zip it
See the alpha help page for more details: https://search.r-project.org/CRAN/refmans/psych/html/alpha.html
Probably OK to keep alpha for some uses, but omega should be the default.
The main issue is that the outputs are quite different. Would need someone familiar with the use of omega to set some sane defaults, if possible.
Should add the output of these lines to test-snapshots.R:
# CREATE SNAPSHOTS TEST LINES
# FILES_TO_SNAPSHOT = list.files(path = "outputs/data", pattern = "df_.*csv$", full.names = TRUE, ignore.case = FALSE)
# FILES_TO_SNAPSHOT %>% walk(~ cat(paste0('testthat::expect_snapshot_file(here::here("', .x, '"))\n')))
Right now, the system checks for all the snapshots of canonical protocol!
Will need to decompress, move the files, and compress again in data and in .vault/
Maybe just zip it and unzip when testing?
We can run a set of targets using THIS:
targets::tar_make(c('target1', 'target2'), callr_function = NULL)
targets::tar_make(c('DF_analysis'), callr_function = NULL)
targets::tar_make(c('DF_analysis'))
Ahora mismo, si el participante recarga la web, continua donde lo dejo (reinicia la ultima prueba no completada).
Un problema asociado es que, un participante puede reintentar una tarea con F5.
Deberiamos tener un parametro similar a accept_discarded para continuar o no donde lo dejaron?
See ropensci/targets#249 for a description and a reproducible example.
See: https://testthat.r-lib.org/articles/snapshotting.html
Function to create/update/delete snapshots of the state of all df_test and main DF's.
See: https://journals.sagepub.com/doi/10.1177/25152459221128319
The data blinding versions would have the DV column shuffled, and the rest of the dataset untouched, so the analysis can be prepared without knowing about the actual relationships of the IV with the DV.
Think about:
run_initial_setup() should move those tasks to .vault, etc.
Example, FORM5 in protocol 20
And folder_tasks should work with the zip file of the protocol we create with run_initial_setup
jsPsychHelpeR::create_new_task("Bayesian31")
Error in jsPsychHelpeR::create_new_task()
:
! R_tasks/prepare_TEMPLATE.R
does NOT exist! You can download from
https://raw.githubusercontent.com/gorkang/jsPsychHelpeR/master/R_tasks/prepare_TEMPLATE.R
SHOULD NOT delete the prepare_TEMPLATE() when cleaning up unused tasks from a project...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.