Skip to content

Commit

Permalink
Fix #48 by fixing name of version and version list in studies object
Browse files Browse the repository at this point in the history
  • Loading branch information
gongcastro committed Sep 4, 2024
1 parent 76ba20b commit b57699f
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/logs.R
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ bvq_logs <- function(participants = bvq_participants(),

# get n items answered by participants (depends on the questionnaire version)
total_items <- studies %>%
distinct(version, language, n) %>%
distinct(version, version_list, language, n) %>%
summarise(
total_items = sum(n),
.by = version
.by = c(version, version_list)
)

grouping_vars <- c(
Expand Down Expand Up @@ -114,7 +114,7 @@ bvq_logs <- function(participants = bvq_participants(),
complete_items = sum(!is.na(response)),
.by = one_of(grouping_vars)
) %>%
left_join(total_items, by = join_by(version)) %>%
inner_join(total_items, by = join_by(version, version_list))
left_join(select(participants, -c(date_birth, version, version_list)),
by = join_by(child_id, time, response_id)
) %>%
Expand Down
Binary file modified R/sysdata.rda
Binary file not shown.
14 changes: 14 additions & 0 deletions data-raw/studies.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## code to prepare `studies` dataset goes here

# uni lemmas
studies <- read.delim(
system.file(file.path("extdata", "studies.csv"),
package = "bvq"
),
sep = ",",
quote = "",
na.strings = c("", "NA")
)

# export pool database
usethis::use_data(studies, languages_lockdown1, languages_lockdown2, languages1, bvq_000, overwrite = TRUE, internal = TRUE)
58 changes: 58 additions & 0 deletions inst/extdata/studies.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
study_db,study,study_id,version,version_list,language,n
Signs,Signs,184,CBC,,Catalan,100
Signs,Signs,184,CBC,,Spanish,99
Signs,Signs,194,CBC,,Catalan,100
Signs,Signs,194,CBC,,Spanish,99
Inhibition +24,Inhibition,191,CBC,,Catalan,100
Inhibition +24,Inhibition,191,CBC,,Spanish,99
Negation 3.0-30-3,Negation,209,CBC,,Catalan,100
Negation 3.0-30-3,Negation,209,CBC,,Spanish,99
Negation 27CAT-27-4,Negation,210,CBC,,Catalan,100
Negation 27CAT-27-4,Negation,210,CBC,,Spanish,99
CognatePriming-30,CognatePriming,219,bvq-long,1,Catalan,772
CognatePriming-30,CognatePriming,219,bvq-long,1,Spanish,786
CognatePriming-30,CognatePriming,219,bvq-long,2,Catalan,785
CognatePriming-30,CognatePriming,219,bvq-long,2,Spanish,796
CognatePriming-24,CognatePriming,229,bvq-long,2,Catalan,785
CognatePriming-24,CognatePriming,229,bvq-long,2,Spanish,796
CognatePriming-20,CognatePriming,233,bvq-long,2,Catalan,785
CognatePriming-20,CognatePriming,233,bvq-long,2,Spanish,796
BiLexicon_10-26,BiLexiconShort,207,bvq-short,A,Catalan,347
BiLexicon_10-26,BiLexiconShort,207,bvq-short,A,Spanish,349
BiLexicon_10-26,BiLexiconShort,207,bvq-short,B,Catalan,345
BiLexicon_10-26,BiLexiconShort,207,bvq-short,B,Spanish,371
BiLexicon_10-26,BiLexiconShort,207,bvq-short,C,Catalan,341
BiLexicon_10-26,BiLexiconShort,207,bvq-short,C,Spanish,369
BiLexicon_10-26,BiLexiconShort,207,bvq-short,D,Catalan,338
BiLexicon_10-26,BiLexiconShort,207,bvq-short,D,Spanish,371
BiLexicon_27-40,BiLexiconShort,208,bvq-short,A,Catalan,347
BiLexicon_27-40,BiLexiconShort,208,bvq-short,A,Spanish,349
BiLexicon_27-40,BiLexiconShort,208,bvq-short,B,Catalan,345
BiLexicon_27-40,BiLexiconShort,208,bvq-short,B,Spanish,371
BiLexicon_27-40,BiLexiconShort,208,bvq-short,C,Catalan,341
BiLexicon_27-40,BiLexiconShort,208,bvq-short,C,Spanish,369
BiLexicon_27-40,BiLexiconShort,208,bvq-short,D,Catalan,338
BiLexicon_27-40,BiLexiconShort,208,bvq-short,D,Spanish,371
BiLexicon-48-55,BiLexiconShort,234,bvq-short,A,Catalan,347
BiLexicon-48-55,BiLexiconShort,234,bvq-short,A,Spanish,349
BiLexicon-48-55,BiLexiconShort,234,bvq-short,B,Catalan,345
BiLexicon-48-55,BiLexiconShort,234,bvq-short,B,Spanish,371
BiLexicon-48-55,BiLexiconShort,234,bvq-short,C,Catalan,341
BiLexicon-48-55,BiLexiconShort,234,bvq-short,C,Spanish,369
BiLexicon-48-55,BiLexiconShort,234,bvq-short,D,Catalan,338
BiLexicon-48-55,BiLexiconShort,234,bvq-short,D,Spanish,371
PhoCross-30-I,PhoCross,217,bvq-long,1,Catalan,772
PhoCross-30-I,PhoCross,217,bvq-long,1,Spanish,786
PhoCross-30-I,PhoCross,217,bvq-long,2,Catalan,785
PhoCross-30-I,PhoCross,217,bvq-long,2,Spanish,796
UB1,UB1,NA,UB,,Catalan,NA
DevLex,DevLex,208,DevLex,,Catalan,225
DevLex,DevLex,208,DevLex,,Spanish,208
Lockdown,Lockdown,0,bvq-lockdown,A,Catalan,347
Lockdown,Lockdown,0,bvq-lockdown,A,Spanish,349
Lockdown,Lockdown,0,bvq-lockdown,B,Catalan,345
Lockdown,Lockdown,0,bvq-lockdown,B,Spanish,371
Lockdown,Lockdown,0,bvq-lockdown,C,Catalan,341
Lockdown,Lockdown,0,bvq-lockdown,C,Spanish,369
Lockdown,Lockdown,0,bvq-lockdown,D,Catalan,338
Lockdown,Lockdown,0,bvq-lockdown,D,Spanish,371

0 comments on commit b57699f

Please sign in to comment.