First off, clone this github repository
git clone [email protected]:hafermoraes/Deaf_DFLE.git
and change directory into its local copy.
cd Deaf_DFLE
To fully reproduce the environment used for the paper, it is recommended to use
docker
(visit https://github.com/docker/docker-install, last accessed on November, 11th 2024, and follow the instructions) anddocker buildx
(visit https://github.com/docker/buildx?tab=readme-ov-file#linux-packages, last accessed on November, 11th 2024, and follow the instructions).
The analyses were made in a computer with GNU Linux Mint installed. If you are using Microsoft Windows, please use WSL to execute the codes bellow. If you are using GNU Linux, any of the BSDs or MAC OS, you are good to go…
The repository already ships with the data preprocessed and ready for analyses and reproduction of tables and figures in the paper.
The following code snippet will mount the analyses/
and data/
folders as well as the .Rprofile
file into a rocker/tidyverse:4.4.1
RStudio Docker container.
docker run -it --rm \
--publish 8787:8787 \
--volume ./analyses/.Rprofile:/home/rstudio/.Rprofile \
--volume ./analyses/:/home/rstudio/analyses/ \
--volume ./data/:/home/rstudio/data/ \
--name deaf_dfle_rr \
--env DISABLE_AUTH=true \
rocker/tidyverse:4.4.1
Before accessing the http://localhost:8787
in the web browser for interacting with the data and scripts, some R packages (located at file analyses/.Rprofile
) need to be installed, which might take a while at each time the following code snippet is executed.
## contents of the file analyses/.Rprofile
##-------------------------------------------------
## install 'survey' package when launching the rstudio docker container
if (interactive()) {
suppressMessages(utils::install.packages("survey", quiet=TRUE))
suppressMessages(utils::install.packages("ggstats", quiet=TRUE))
suppressMessages(utils::install.packages("PNSIBGE", quiet=TRUE))
suppressMessages(utils::install.packages("svglite", quiet=TRUE))
}
If needed, fetch the data once again by executing the following command at the repository root’s folder
# execute the command bellow from the Deaf_DLFE/ root folder
make fetch_data
and the execute the following command to build the RStudio Docker container prepackaged with the additional R packages according to the Dockerfile at docker/Dockerfile
# execute the command bellow from the Deaf_DLFE/ root folder
make build
Open the web browser and access http://localhost:8787/
.
If you wish, you can also interact with the scripts using your own local versions of GNU R and RStudio without having to resort to Docker.
Note however that the results in the paper may not be fully reproducible due to differences in the GNU R version and its packages versions.
In this case you can directly interact with the RMarkdown scripts at the analyses/
folder but you will have to adapt the paths to the datasets.
Simply change /home/rstudio/
by the path to the data/
folder in your computer after you’ve cloned this repo.
You will have to perform these changes at each RMarkdown file in the analyses/
folder you plan to interact with.