Setup the Project
setup-the-project.Rmd
Setting Up the Project
Docker
The easiest way to activate and use the project, as well as run the pipeline, is by using Docker. To proceed, ensure Docker is installed on your machine. If Docker is not yet installed, follow the instructions on the Docker website.
- Download the
docker-compose.yaml
file to any folder on your host machine. - Ensure the Docker engine is running.
- Open a terminal window (use CMD on Windows, as PS has not been tested), and run the following command to start the container:
Note: You can manually create the
docker-compose.yaml
file with the following content:version: "3.8" services: server: image: "corradolanera/jecfa:latest" container_name: jecfa_rstudio ports: - 18787:8787 environment: - PASSWORD=jecfa restart: unless-stopped volumes: - type: volume source: jecfa_targets target: /home/rstudio/jecfa/_targets - type: volume source: jecfa_data target: /home/rstudio/jecfa/data - type: volume source: jecfa_output target: /home/rstudio/jecfa/output - type: volume source: jecfa_report target: /home/rstudio/jecfa/report volumes: jecfa_targets: jecfa_data: jecfa_output: jecfa_report:
Next, open any browser on your host machine and visit
localhost:18787
to access the RStudio Server with all
dependencies installed and ready for use.
-
Username:
rstudio
-
Password:
jecfa
Once logged in to the RStudio server, navigate to the
jecfa/
folder (the only folder visible) and activate the
project by clicking on the jecfa.Rproj
file.
When you have finished your work, you can close your browser and stop the container by running the following command in your terminal:
Local RStudio
To run the pipeline in your local RStudio:
- Clone the project from GitHub (https://github.com/UBESP-DCTV/jecfa).
- Open the project in RStudio.
To clone the project, you have several options. For example:
- Open RStudio.
- Click on
File
->New Project...
->Version Control
->Git
. - Paste the URL (
https
orssh
) of the project repository into theRepository URL
field.
Next, install all project dependencies. These dependencies are
managed automatically by renv
, so you will need to install
renv
(that will automatically done at project start-up if
not yet installed) and restore the project dependencies. To do this,
open the project in RStudio and run:
renv::restore()
Follow the instructions provided. Once completed, you can open and
work on the project (see the run-pipeline
to learn what
does it means and how to “run the pipeline”).