<- c(
pkgs 'r5r',
'accessibility',
'rJavaEnv',
'ggplot2',
'mapview',
'quantreg',
'dplyr',
'h3jsr',
'sf'
)
install.packages(pkgs)
To follow the workshop, you should have the following programs installed on your machine before the day of the workshop.
- R and RStudio
- A few R packages
- Java JDK 21
See instructions below:
Installing R and RStudio
We assume you already have R and RStudio installed on your machine. In case you don’t, follow these simple instructions here.
Installing R packages
The workshop uses a few R packages that need to be installed on your machine. The simplest way to do this is running the code below. This might take a few minutes if this is the first time you install these packages.
The safest way to replicate the code of this workshop, though, is cloning its repository locally. This is because this repository uses the {renv}
R package to manage the package dependencies of the code we use. This is important to make sure we are using the same versions of the relevant packages.
Once you have cloned the repo and you’ve opened the access_workshop_eit_2024.Rproj
file, you can simply run renv::restore()
to install all the package dependencies used in this workshop.
# uncomment the line below in case you need to install the {renv} package
# install.packages('renv')
::restore() renv
Installing Java
To use the {r5r}
package (version v2.0 or higher), you will need to have Java Development Kit (JDK) 21 installed on your computer. There are numerous open-source JDK implementations. The easiest way to install JDK is using the new {rJavaEnv} package in R, developed by Egor Kotov (thanks Egor!).
# check version of Java currently installed (if any)
::java_check_version_rjava()
rJavaEnv
## if this is the first time you use {rJavaEnv}, you might need to run this code
## below to consent the installation of Java.
# rJavaEnv::rje_consent(provided = TRUE)
# install Java 21
::java_quick_install(
rJavaEnvversion = 21,
distribution = 'Corretto')
# check if Java was successfully installed
::java_check_version_rjava() rJavaEnv
Alternatively, you can manually download and install any of these JDK implementations:
Here are a few accompanying slides explaining the computational requirements to conduct transport routing and accessibility analysis with R
.