Browse Source

compilation fix and additional instructions

Lucas Gautheron 3 months ago
parent
commit
d7c9b311f1
3 changed files with 22 additions and 9 deletions
  1. 5 5
      CODE/SM.Rmd
  2. 17 4
      README.md
  3. BIN
      SM.pdf

+ 5 - 5
CODE/SM.Rmd

@@ -80,7 +80,7 @@ if(RECALC) source("create-all-rs.R")
 
 ```{r readin}
 
-df.icc.simu <- read.csv("../output/df.icc.simu.csv") #365 rows because there are multiple rows per metric as a function of r
+df.icc.simu <- read.csv("../OUTPUT/df.icc.simu.csv") #365 rows because there are multiple rows per metric as a function of r
 
 mydat_aclew <- read.csv(paste0('../data_output/', 'aclew','_metrics_scaled.csv')) 
 mydat_aclew <- mydat_aclew[is.element(mydat_aclew$experiment, corpora),]
@@ -91,19 +91,19 @@ mydat_lena <- mydat_lena[is.element(mydat_lena$experiment, corpora),]
 all_rs <- read.csv("../data_output/all_rs.csv")
 dist_contig_lena <- read.csv("../data_output/dist_contig_lena.csv")
 
-df.icc.mixed<-read.csv("../output/df.icc.mixed.csv")
+df.icc.mixed<-read.csv("../OUTPUT/df.icc.mixed.csv")
 df.icc.mixed$Type<-get_type(df.icc.mixed)
 
 
 mydat2 <- read.csv("../data_output/dat_sib_ana.csv")
 
-df.icc.age<-read.csv("../output/df.icc.age.csv")
+df.icc.age<-read.csv("../OUTPUT/df.icc.age.csv")
 age_levels=c("(0,6]" , "(6,12]",  "(12,18]" ,"(18,24]" ,"(24,30]", "(30,36]" )
 #not present in data: , "(36,42]", "(42,48]", "(48,54]"
 df.icc.age$age_bin<-factor(df.icc.age$age_bin,levels=age_levels)
 df.icc.age$Type<-get_type(df.icc.age)
 
-df.icc.corpus<-read.csv("../output/df.icc.corpus.csv")
+df.icc.corpus<-read.csv("../OUTPUT/df.icc.corpus.csv")
 df.icc.corpus$Type <- get_type(df.icc.corpus)
 
 ```
@@ -182,7 +182,7 @@ location=c("Northeast US", "Northwest US", "Western US", "Northwest England", "C
 
 corpus_description=cbind(corpus,location,chiXcor, recRXchi, recXcor, durXcor, ageXcor,ageRXcor)
 
-write.table(corpus_description, "../output/corpus_description.csv", sep='\t')
+write.table(corpus_description, "../OUTPUT/corpus_description.csv", sep='\t')
 
 kable(corpus_description,caption="Table 2 (reproduced).")
 

+ 17 - 4
README.md

@@ -22,11 +22,24 @@ Some readers may want to check our materials for reproducibility. To regenerate
 If you simply want to check the reproducibility of the paper analyses, you can download a zipped version from [our GIN repo](https://gin.g-node.org/laac-lscp/relival), by clicking on the button that looks like a downward pointing arrow, near the top right of the page (under Publications; see to-download-zip.jpg).
 
 1. Unzip the downloaded zip folder.
-4. Double click on the CODE folder, and on SM.Rmd to launch RStudio with the correct working directory (or if RStudio is already running, change working directory into the unzipped folder)
-5. Click on the "knit" button near the top of the RStudio window
-6. If anything fails, the most likely issue will be that you are missing a library. For most of the packages, you can install the package through the GUI menu or by typing in the commands section (near the bottom of the RStudio window) `install.package("LIBRARYNAME")` (replace LIBRARYNAME with the package that the system said was not found). If the package missing is papaja, please follow instructions [here](https://github.com/crsh/papaja).
-7. If anything looks different, please double-check that you are using the same versions of all packages by looking at the capture of the environment at the very end of the .pdf file
+2. Double click on the CODE folder, and on SM.Rmd to launch RStudio with the correct working directory (or if RStudio is already running, change working directory into the unzipped folder)
+3. Click on the "knit" button near the top of the RStudio window
+4. If anything fails, the most likely issue will be that you are missing a library. For most of the packages, you can install the package through the GUI menu or by typing in the commands section (near the bottom of the RStudio window) `install.package("LIBRARYNAME")` (replace LIBRARYNAME with the package that the system said was not found). If the package missing is papaja, please follow instructions [here](https://github.com/crsh/papaja).
+Dependencies can be quickly installed by issuing the following command in Rstudio:
+
+```R
+list.of.packages <- c("lme4","performance","ggplot2","ggthemes","ggpubr","kableExtra","psych","dplyr","tidyr","stringr","car","ggbeeswarm")
+new.packages <- list.of.packages[!(list.of.packages %in% installed.packages()[,"Package"])]
+if(length(new.packages)) install.packages(new.packages)
+```
+
+5. If anything looks different, please double-check that you are using the same versions of all packages by looking at the capture of the environment at the very end of the .pdf file
+
+It is also possible to generate the supplementary materials from the command line (without opening Rstudio) in a single instruction:
 
+```bash
+Rscript -e 'library(rmarkdown); rmarkdown::render("CODE/SM.Rmd", "pdf_document", output_file = "SM.pdf")'
+```
 
 # Raw Data Access
 

BIN
SM.pdf