Skip to content

Commit

Permalink
Merge pull request #49 from gongcastro/test
Browse files Browse the repository at this point in the history
Fix #48 by fixing name of version and version list in studies object
  • Loading branch information
gongcastro authored Sep 4, 2024
2 parents 795ebc7 + 3159993 commit 3f2940b
Show file tree
Hide file tree
Showing 8 changed files with 131 additions and 57 deletions.
80 changes: 40 additions & 40 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -21,43 +21,43 @@ export(prop_adj)
export(track_progress)
import(dplyr)
import(rlang)
importFrom(cli, cli_abort)
importFrom(cli, cli_alert_success)
importFrom(cli, cli_alert_warning)
importFrom(cli, cli_progress_done)
importFrom(cli, cli_progress_step)
importFrom(cli, cli_progress_update)
importFrom(cli, qty)
importFrom(dplyr, across)
importFrom(dplyr, case_when)
importFrom(dplyr, distinct)
importFrom(dplyr, filter)
importFrom(dplyr, if_any)
importFrom(dplyr, mutate)
importFrom(dplyr, n)
importFrom(formr, formr_connect)
importFrom(formr, formr_raw_results)
importFrom(googlesheets4, gs4_auth)
importFrom(googlesheets4, gs4_has_token)
importFrom(googlesheets4, read_sheet)
importFrom(janitor, make_clean_names)
importFrom(lifecycle, deprecated)
importFrom(lubridate, as_date)
importFrom(lubridate, as_datetime)
importFrom(lubridate, time_length)
importFrom(lubridate, today)
importFrom(magrittr, "%>%")
importFrom(purrr, map)
importFrom(purrr, set_names)
importFrom(readxl, excel_sheets)
importFrom(readxl, read_xlsx)
importFrom(rlang, ":=")
importFrom(rlang, .data)
importFrom(rlang, as_label)
importFrom(rlang, as_name)
importFrom(rlang, enquo)
importFrom(rlang, enquos)
importFrom(tibble, tibble)
importFrom(tidyr, pivot_longer)
importFrom(tidyr, pivot_wider)
importFrom(utils, browseURL)
importFrom(cli,cli_abort)
importFrom(cli,cli_alert_success)
importFrom(cli,cli_alert_warning)
importFrom(cli,cli_progress_done)
importFrom(cli,cli_progress_step)
importFrom(cli,cli_progress_update)
importFrom(cli,qty)
importFrom(dplyr,across)
importFrom(dplyr,case_when)
importFrom(dplyr,distinct)
importFrom(dplyr,filter)
importFrom(dplyr,if_any)
importFrom(dplyr,mutate)
importFrom(dplyr,n)
importFrom(formr,formr_connect)
importFrom(formr,formr_raw_results)
importFrom(googlesheets4,gs4_auth)
importFrom(googlesheets4,gs4_has_token)
importFrom(googlesheets4,read_sheet)
importFrom(janitor,make_clean_names)
importFrom(lifecycle,deprecated)
importFrom(lubridate,as_date)
importFrom(lubridate,as_datetime)
importFrom(lubridate,time_length)
importFrom(lubridate,today)
importFrom(magrittr,"%>%")
importFrom(purrr,map)
importFrom(purrr,set_names)
importFrom(readxl,excel_sheets)
importFrom(readxl,read_xlsx)
importFrom(rlang,":=")
importFrom(rlang,.data)
importFrom(rlang,as_label)
importFrom(rlang,as_name)
importFrom(rlang,enquo)
importFrom(rlang,enquos)
importFrom(tibble,tibble)
importFrom(tidyr,pivot_longer)
importFrom(tidyr,pivot_wider)
importFrom(utils,browseURL)
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
4 changes: 3 additions & 1 deletion man/bvq_connect.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 12 additions & 12 deletions man/bvq_norms.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/track_progress.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3f2940b

Please sign in to comment.