Skip to contents

In order to reproduce the results of this project we need to follow the following steps to run the code using the same environment:

  1. Install docker by installing Docker Desktop or just the Docker Engine if Linux is your operating system. I used this article as a guide to complete the task on debian 12.

  2. Install git.

sudo apt install git
  1. Download the image related with this project.
docker pull angelfelizr/project.nyc.taxi:0.0.0.9000
  1. Select the parent directory to save your project and confirm its path by running.
pwd
  1. Create a directory to save the installed packages.
mkdir r-lib-4.4
  1. Create other directory to cache installed packages.
mkdir cache_4.4
  1. Download the repo by running git clone or downloading as a zip.
git clone https://github.com/AngelFelizR/project.nyc.taxi.git
  1. Update the docker-compose.yml file with your parent directory path.
services:
  taxi_project:
    image: angelfelizr/project.nyc.taxi:0.0.0.9000
    container_name: TaxiProject
    environment:
      - DISABLE_AUTH=true
      - RENV_PATHS_CACHE=/home/rstudio/.cache/R/renv/library/project.nyc.taxi-dd1eca8a/linux-ubuntu-jammy/R-4.4/x86_64-pc-linux-gnu
    ports:
      - "127.0.0.1:5555:8787"
    volumes:
      - [parent directory path]:/home/rstudio
      - [parent directory path]/r-lib-4.4:/usr/local/lib/R/site-library
      - [parent directory path]/cache_4.4:/home/rstudio/.cache/R/renv/library/project.nyc.taxi-dd1eca8a/linux-ubuntu-jammy/R-4.4/x86_64-pc-linux-gnu
  1. After creating both folders we can run our container by running the next command based on your working directory.
docker compose up -d
  1. Then you can go to your favorite browser and go to localhost:5555. This address is used to access the RStudio Server interface running in the Docker container.

  2. Click over ~/project.nyc.taxi/project.nyc.taxi.Rproj to open the project.

  3. Open an R console or an R script in the RStudio interface.

  4. Install the packages used:

renv::restore()
  1. To reproduce the analysis presented, we have two alternatives:
devtools::build_rmd("vignettes/01-data-collection-process.Rmd")
  • Installing the local library to be able to run the code in an interactive session.
devtools::install_local()
  1. When you’re done with your work and want to stop the container, you can use the following command:
docker container kill TaxiProject

Note: Make sure to save your work before stopping the container.