langcog / metalab

MetaLab -- Community-augmented meta-analysis
6 stars 8 forks source link

Error in R updating metalab data #83

Closed lottiegasp closed 3 years ago

lottiegasp commented 3 years ago

@erikriverson I get an error when I try to run source(here::here("build", "update-metalab-data.R")) in R on my machine after adding a new dataset. All datasets up to Mutual exclusivity work (I haven't included the R output for these as they look straightforward) then I get the code right at the end.

... Getting raw MetaLab data from Google Sheets for dataset: Mutual exclusivity tibble [146 x 50] (S3: spec_tbl_df/tbl_df/tbl/data.frame) $ study_ID : chr [1:146] "allen2010" "bedford2013" "bedford2013" "beverly2003" ... $ short_cite : chr [1:146] "Allen & Scofield (2010)T" "Beford et al (2013)" "Beford et al (2013)" "Beverly & Estis (2003)" ... $ long_cite : chr [1:146] "Allen, R., & Scofield, J. (2010). Word learning form videos: More evidence from 2-year-olds. Infant and Child D"| truncated "Bedford, R., Gliga, T., Frame, K., Hudry, K., Chandler, S., Johnson, M. H., ... & BASIS TEAM. (2013). Failure t"| truncated "Bedford, R., Gliga, T., Frame, K., Hudry, K., Chandler, S., Johnson, M. H., ... & BASIS TEAM. (2013). Failure t"| truncated "Beverly, B. L; Estis, J. M. Journal of Speech-Language Pathology and Audiology.Vol. 27, Iss. 3, (October 2003): 163-171." ... $ doi : logi [1:146] NA NA NA NA NA NA ... $ peer_reviewed : chr [1:146] "yes" "yes" "yes" "yes" ... $ coder : chr [1:146] "Molly Lewis" "Molly Lewis" "Molly Lewis" "Molly Lewis" ... $ expt_num : num [1:146] 2 1 1 1 1 1 2 2 2 1 ... $ response_mode : chr [1:146] "behavior" "behavior" "behavior" "behavior" ... $ response_mode2 : chr [1:146] "behavior" "behavior" "behavior" "behavior" ... $ dependent_measure : chr [1:146] "target_selection" "target_selection" "target_selection" "target_selection" ... $ native_lang : chr [1:146] NA NA NA NA ... $ infant_type : chr [1:146] "typical" "NT" "typical" "NT" ... $ infant_type2 : chr [1:146] "typical" "ASD" "typical" "SLI" ... $ group_name_1 : chr [1:146] "experimental" "ASD- high risk" "typical" "experimental" ... $ n_1 : num [1:146] 32 31 31 5 5 5 20 22 25 16 ... $ mean_age_1 : num [1:146] 1004 749 740 1765 1796 ... $ same_infant : chr [1:146] "6" "7" "8" "9" ... $ x_1 : num [1:146] 0.76 NA NA 0.65 0.95 0.9 0.68 0.52 0.65 0.08 ... $ x_2 : num [1:146] 0.5 NA NA 0.5 0.5 0.5 0.5 0.5 0.5 0 ... $ SD_1 : num [1:146] NA NA NA 0.058 0.1 0.082 0.14 0.14 0.13 0.19 ... $ t : num [1:146] 6.25 3.88 3.41 NA NA NA 5.9 0.59 5.34 1.69 ... $ F : logi [1:146] NA NA NA NA NA NA ... $ d : num [1:146] NA NA NA NA NA ... $ d_var : num [1:146] NA NA NA NA NA ... $ age_range_1 : num [1:146] NA NA NA NA NA ... $ age_range_2 : logi [1:146] NA NA NA NA NA NA ... $ n_excluded_1 : num [1:146] NA NA NA NA NA NA 5 10 8 NA ... $ gender_1 : num [1:146] NA NA NA NA NA NA NA NA NA NA ... $ num_trials : num [1:146] 4 4 4 10 10 10 8 8 8 6 ... $ object_stimulus : chr [1:146] "digital" "objects" "objects" "objects" ... $ N_AFC : chr [1:146] "N_AFC-2" "N_AFC-3" "N_AFC-3" "N_AFC-2" ... $ mean_comprehension_vocab: num [1:146] NA 335 449 NA NA ... $ mean_production_vocab : num [1:146] NA NA NA NA NA NA 534 NA NA 35 ... $ ME_trial_type : chr [1:146] "NN" "FN" "FN" "FN" ... $ lab_group : chr [1:146] "scofield" "charman" "charman" "estis" ... $ data_source : chr [1:146] "paper" "paper" "paper" "paper" ... $ expt_condition : chr [1:146] "experimental" "experimental" "experimental" "experimental" ... $ exposure_phase : chr [1:146] "test_only" "test_only" "test_only" "test_only" ... $ method : chr [1:146] "FC" "FC" "FC" "FC" ... $ participant_design : chr [1:146] "within_one" "within_one" "within_one" "within_one" ... $ group_name_2 : logi [1:146] NA NA NA NA NA NA ... $ n_2 : logi [1:146] NA NA NA NA NA NA ... $ mean_age_2 : logi [1:146] NA NA NA NA NA NA ... $ SD_2 : logi [1:146] NA NA NA NA NA NA ... $ r : logi [1:146] NA NA NA NA NA NA ... $ corr : logi [1:146] NA NA NA NA NA NA ... $ n_excluded_2 : logi [1:146] NA NA NA NA NA NA ... $ gender_2 : logi [1:146] NA NA NA NA NA NA ... $ N_Langs : logi [1:146] NA NA NA NA NA NA ... $ d_notes : chr [1:146] NA NA NA NA ...

erikriverson commented 3 years ago

Hi @lottiegasp !

This happened because in spec.yaml, sentence_structure and mean_production_vocab were missing the "type" property. In the case of mean_production_vocab, it was already included as a field from a previous analysis and was type numeric, so I removed the second one without a type. For sentence_structure, I made it type string.

I will create an issue here to remind us to write some functions to validate spec.yaml for these sorts of things.

lottiegasp commented 3 years ago

Thanks @erikriverson , it's working now!