Skip to content

diogo-almeida/TuckerIdrissiAlmeida2021

Repository files navigation

Launch Rstudio Binder DOI DOI

Research compendium for Tucker, Idrissi & Almeida (2021).

A compendium of code and data accompanying the publication:

Tucker , Idrissi , & Almeida . (2021). Attraction effects for verbal gender and number are similar but not identical: self-paced reading evidence from Modern Standard Arabic. Published in Frontiers in Psychology, Language Sciences, https://doi.org/10.3389/fpsyg.2020.586464

This compendium should allow for the reproduction of all figures and tables reported in the paper.

Running the scripts

On your own computer, with your own R and RStudio installations

If you have R and RStudio installed, it should be as easy as:

  1. Clone or download this repository

  2. Click on the "AnalysisScripts.Rproj" (it should open an RStudio session)

  3. Open the file "00-ReproduceAnalyses-Tucker_et_al_2021.R"

  4. Run the "Source" command from the RStudio menu

The analysis scripts will create a folder for each experiment as well as meta-analysis. Within each folder, you will find the original datasets used in the analysis as well as the reproduced figures and tables.

NOTE: Whether the script will run out of the box will depend entirely on whether your own R and RStudio installations are compatible enough with the computational environment used in creating and testing the scripts. The scripts were only tested with:

  • R (tested with versions 3.6.3 and 4.0.3)
  • RStudio (tested with version 1.3.1093)

A fuller picture about that original computational environment can be found in the file tucker2001_original_session_info_for_comparisons.txt.

Running the scripts online in mybinder.org

Alternatively, you may also click the badge Launch Rstudio Binder to start an RStudio version on your browser. It may take a while for it to start, though. You can then follow the same instructions as above.

Also, keep in mind that this is under testing and may fail. I managed to get it to work at the time of this writing, but YMMV.

Running the scripts on your computer using Docker

If you would like to run the scripts on your own computer but do not want to have to worry about potentially having to change your R and/or RStudio installations, you can use Docker to replicate a full computational environment used in the creation and testing of the scripts, and so it's guaranteed to run on your computer regardless of what you R or RStudio installations may be.

Requirements:

  1. Having Git installed on your computer
  2. Having Docker installed on your computer
  3. Having at least 5 Gb of free disk space for building the Docker image on your own computer

Steps:

  1. On the command line, find a suitable directory and build a docker image of this repository on your local computer. The following command will create a new docker image called rr-tucker-et-al-2021:
docker build -t rr-tucker-et-al-2021 https://github.com/diogo-almeida/TuckerIdrissiAlmeida2021.git#main

NOTE: It will take perhaps a few minutes to build the Docker image locally, but it only needs to be run once.

  1. Start the container:
docker run --rm -p 8888:8888 rr-tucker-et-al-2021 
  1. Copy the URL that is given at the end of the output of the previous command, and paste it onto a web browser. This will open a Jupyter Notebook interface.

  2. On the Jupyter Notebook interface, ther will be a button New on the top right hand side of the screen, next to the button Upload. Click on New and choose RStudio, which should be the last option on the menu. This will open an interactive RStudio session on your web browser.

  3. Open the file "00-ReproduceAnalyses-Tucker_et_al_2021.R"

  4. Run the "Source" command from the RStudio menu

Stopping and Removing the Docker image

Once you have finished working on the Docker image, you can stop the image by typing the following command on the command line:

docker stop <container_id>

where <container_id> can be found by typing the following command:

docker ps -a

If you want to run the image again, go to step 2 above.

If you do not plan on running the image again, or if you just want to save disk space, you can delete the image by issuing the following command:

docker image rm <image_id>

where <image_id> can be found by typing the following command:

docker image ls

NOTE: Once the docker image is deleted, you will need to build it again before you can use it (i.e., go back to step 1).

Supplementary Materials

In the folder supplementary_materials, you will find the full list of sentences used in the experiments reported in the paper as an Rmarkdown document. You can peruse the document as is as RMarkdown is quite human-readable. Alternatively, you can generate a pdf by opening the Rmarkdown document in RStudio (in your own local installation or using the the RStudio session in Binder as described above), and pressing "Knit".

In order to generate the pdf, however, you will need to install the font Markazi Text, which is available for free on Google Fonts.

Notes

  1. It may be possible to run the scripts without RStudio. I have no idea on how to do it, though, so I cannot offer any support for it.

  2. The bootstrapped CIs reported in the paper will differ a little from the ones generated from these scripts. We forgot to set a reproducible seed on the original analysis scripts, so the exact bootstrapped CIs reported in the paper are not reproducible, but the ones from the scripts are.

Licenses

Text & Data: CC-BY-4.0

Code: GPL-3

About

A compendium of code and data for reproducing all tables and figures of Tucker, Idrissi, & Almeida. (2021). https://doi.org/10.3389/fpsyg.2020.586464

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published