diff --git a/dev/articles/accessibility.html b/dev/articles/accessibility.html index 7168de47..d306dd27 100644 --- a/dev/articles/accessibility.html +++ b/dev/articles/accessibility.html @@ -110,7 +110,7 @@
vignettes/accessibility.Rmd
accessibility.Rmd
vignettes/detailed_itineraries.Rmd
detailed_itineraries.Rmd
vignettes/faq.Rmd
faq.Rmd
vignettes/fare_structure.Rmd
fare_structure.Rmd
tail(fare_structure$fares_per_route)
-#> agency_id agency_name route_id
-#> <char> <char> <char>
-#> 1: EPTC Empresa Publica de Transportes e Circulação T8
-#> 2: EPTC Empresa Publica de Transportes e Circulação T9
-#> 3: EPTC Empresa Publica de Transportes e Circulação TR60
-#> 4: EPTC Empresa Publica de Transportes e Circulação TR62
-#> 5: TRENS TRENSURB LINHA1
-#> 6: TRENS TRENSURB LINHAAERO
-#> route_short_name route_long_name mode route_fare
-#> <char> <char> <char> <num>
-#> 1: T8 CAMPUS / FARRAPOS BUS 4.8
-#> 2: T9 PUC BUS 4.8
-#> 3: TR60 TRONCAL TRI‘NGULO BUS 4.8
-#> 4: TR62 TRONCAL BALTAZAR BUS 4.8
-#> 5: LINHA1 ESTACAO MERCADO ATE ESTACAO NOVO HAMBURGO RAIL 4.8
-#> 6: AREO AEROMOVEL TRENSURB RAIL 4.8
-#> fare_type
-#> <char>
-#> 1: BUS
-#> 2: BUS
-#> 3: BUS
-#> 4: BUS
-#> 5: RAIL
-#> 6: RAIL
Basic route information is taken directly from the GTFS data (agency,
route id and names, mode, etc), but the route_fare
and
fare_type
columns were added specifically for the
diff --git a/dev/articles/fare_structure_files/figure-html/unnamed-chunk-3-1.png b/dev/articles/fare_structure_files/figure-html/unnamed-chunk-3-1.png
index d9f9ecf0..eadbd5f2 100644
Binary files a/dev/articles/fare_structure_files/figure-html/unnamed-chunk-3-1.png and b/dev/articles/fare_structure_files/figure-html/unnamed-chunk-3-1.png differ
diff --git a/dev/articles/isochrones.html b/dev/articles/isochrones.html
index d70e765e..adfe93fe 100644
--- a/dev/articles/isochrones.html
+++ b/dev/articles/isochrones.html
@@ -110,7 +110,7 @@
vignettes/isochrones.Rmd
isochrones.Rmd
vignettes/pareto_frontier.Rmd
pareto_frontier.Rmd
pareto_frontier(
shopping mall and (b) the Moinhos hospital. An optimum route alternative
means that one cannot make a faster trip without increasing costs, and
one cannot make a cheaper trip without increasing travel time.
-#> Warning: Invalid .internal.selfref detected and fixed by taking a (shallow)
-#> copy of the data.table so that := can add this new column by reference. At an
-#> earlier point, this data.table has been copied by R (or was created manually
-#> using structure() or similar). Avoid names<- and attr<- which in R currently
-#> (and oddly) may copy the whole data.table. Use set* syntax instead to avoid
-#> copying: ?set, ?setnames and ?setattr. If this message doesn't help, please
-#> report your use case to the data.table issue tracker so the root cause can be
-#> fixed or this message improved.
+#> Warning in `[.data.table`(pf2, , `:=`(modes, fcase(monetary_cost == 1, "Walk",
+#> : Invalid .internal.selfref detected and fixed by taking a (shallow) copy of
+#> the data.table so that := can add this new column by reference. At an earlier
+#> point, this data.table has been copied by R (or was created manually using
+#> structure() or similar). Avoid names<- and attr<- which in R currently (and
+#> oddly) may copy the whole data.table. Use set* syntax instead to avoid copying:
+#> ?set, ?setnames and ?setattr. If this message doesn't help, please report your
+#> use case to the data.table issue tracker so the root cause can be fixed or this
+#> message improved.
#> Warning: A numeric `legend.position` argument in `theme()` was deprecated in ggplot2
#> 3.5.0.
#> ℹ Please use the `legend.position.inside` argument of `theme()` instead.
diff --git a/dev/articles/r5r.html b/dev/articles/r5r.html
index 3c45b578..2ab8c37d 100644
--- a/dev/articles/r5r.html
+++ b/dev/articles/r5r.html
@@ -113,7 +113,7 @@ Intro to r5r: Rapid Realistic Routing with R5 in
Rafael H. M.
Pereira, Marcus Saraiva, Daniel Herszenhut, Carlos Kaue Braga
- 2024-07-19
+ 2024-08-27
Source: vignettes/r5r.Rmd
r5r.Rmd
@@ -123,7 +123,7 @@ 2024-07-19
Abstract
- r5r
is an R package for rapid realistic routing on
+ r5r is an R package for rapid realistic routing on
multimodal transport networks (walk, bike, public transport and
car) using R5. The package allows users to generate
detailed routing analysis or calculate travel time matrices using
@@ -147,16 +147,16 @@ 1. Introduction
2. Installation
-You can install r5r
from CRAN, or the development
+
You can install r5r from CRAN, or the development
version from github.
-# CRAN
+# from CRAN
install.packages('r5r')
-# dev version on github
+# dev version with latest features
devtools::install_github("ipeaGIT/r5r", subdir = "r-package")
Please bear in mind that you need to have Java Development Kit
-(JDK) 21 installed on your computer to use r5r
. No
+(JDK) 21 installed on your computer to use r5r. No
worries, you don’t have to pay for it. There are numerous open-source
JDK implementations, and you only need to install one JDK. Here are a
few options:
@@ -168,25 +168,38 @@ 2. Installation
Oracle OpenJDK.
-
If you don’t know what version of Java you have installed on your
-computer, you can check it by running this on R console.
+The easiest way to install JDK is using the new {rJavaEnv} package in R:
+# install {rJavaEnv} from CRAN
+install.packages("rJavaEnv")
+
+# check version of Java currently installed (if any)
+rJavaEnv::java_check_version_rjava()
+
+## 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
+rJavaEnv::java_quick_install(version = 21)
+
+# check if Java was successfully installed
+rJavaEnv::java_check_version_rjava()
Before we start, we need to increase the memory available to Java.
-This is necessary because, by default, R
allocates only
-512MB of memory for Java processes, which is not enough for large
-queries using r5r
. To increase available memory to 2GB, for
-example, we need to set the java.parameters
option at the
-beginning of the script, as follows:
First, we need to increase the memory available to Java. This has to
+be done before loading the r5r library
+because, by default, R
allocates only 512MB of memory for
+Java processes, which is not enough for large queries using
+r5r. To increase available memory to 2GB, for example, we
+need to set the java.parameters
option at the beginning of
+the script, as follows:
options(java.parameters = "-Xmx2G")
Note: It’s very important to allocate enough memory before loading
-r5r
or any other Java-based package, since
+r5r or any other Java-based package, since
rJava
starts a Java Virtual Machine only once for each R
session. It might be useful to restart your R session and execute the
code above right after, if you notice that you haven’t succeeded in your
@@ -197,11 +210,11 @@
The The r5r package has seven fundamental
functions:r5r
package has seven fundamental
+
setup_r5()
to initialize an instance of
-r5r
, that also builds a routable transport
+r5r, that also builds a routable transport
network;accessibility()
for fast computation of access to
opportunities considering a selected decay function;3. Usage
To illustrate the functionalities of r5r
, the package
+
To illustrate the functionalities of r5r, the package includes a small sample data for the city of Porto Alegre (Brazil). It includes seven files:
setup_r5
function. This function does two things: (1) downloads/updates a
compiled JAR file of R5 and stores it locally in the
-r5r
package directory for future use; and (2) combines the
-osm.pbf and gtfs.zip data sets to build a routable network object.
+r5r package directory for future use; and (2) combines
+the osm.pbf and gtfs.zip data sets to build a routable network
+object.
# Indicate the path where OSM and GTFS data are stored
r5r_core <- setup_r5(data_path = data_path)
r5r
objects are still allocated to any amount of memory
-previously set after they are done with their calculations. In order to
-remove an existing r5r
object and reallocate the memory it
-had been using, we use the stop_r5
function followed by a
-call to Java’s garbage collector, as follows:
r5r objects are still allocated to any amount of
+memory previously set after they are done with their calculations. In
+order to remove an existing r5r object and reallocate the
+memory it had been using, we use the stop_r5
function
+followed by a call to Java’s garbage collector, as follows:
vignettes/time_window.Rmd
time_window.Rmd
time_windo
#> <char> <char> <int> <int> <num>
#> 1: 89a8100c603ffff schools 10 45 13
#> 2: 89a8100c603ffff schools 20 45 13
-#> 3: 89a8100c603ffff schools 50 45 7
+#> 3: 89a8100c603ffff schools 50 45 6
#> 4: 89a8100c603ffff schools 70 45 6
#> 5: 89a8100c603ffff schools 80 45 6
#> 6: 89a8100c617ffff schools 10 45 14
#> 7: 89a8100c617ffff schools 20 45 14
-#> 8: 89a8100c617ffff schools 50 45 13
+#> 8: 89a8100c617ffff schools 50 45 10
#> 9: 89a8100c617ffff schools 70 45 6
#> 10: 89a8100c617ffff schools 80 45 6
This output is in long format, so the first 5 rows show the result @@ -394,16 +394,16 @@
time_window
.
diff --git a/dev/articles/time_window_files/figure-html/unnamed-chunk-4-1.png b/dev/articles/time_window_files/figure-html/unnamed-chunk-4-1.png
index 6b09f3af..4916c0e5 100644
Binary files a/dev/articles/time_window_files/figure-html/unnamed-chunk-4-1.png and b/dev/articles/time_window_files/figure-html/unnamed-chunk-4-1.png differ
diff --git a/dev/articles/travel_time_matrix.html b/dev/articles/travel_time_matrix.html
index eacb55e0..179d9699 100644
--- a/dev/articles/travel_time_matrix.html
+++ b/dev/articles/travel_time_matrix.html
@@ -110,7 +110,7 @@
vignettes/travel_time_matrix.Rmd
travel_time_matrix.Rmd
-# From CRAN
- install.packages("r5r")
- library(r5r)
+# from CRAN
+install.packages("r5r")
-# or use the development version with latest features
- utils::remove.packages('r5r')
- devtools::install_github("ipeaGIT/r5r", subdir = "r-package")
- library(r5r)
Please bear in mind that you need to have Java Development Kit (JDK) 21 installed on your computer to use r5r
. No worries, you don’t have to pay for it. There are numerous open-source JDK implementations, any of which should work with r5r
. If you don’t already have a preferred JDK, we recommend Adoptium/Eclipse Temurin. Other open-source JDK implementations include Amazon Corretto, and Oracle OpenJDK. You only need to install one JDK.
If you don’t know what version of Java you have installed on your computer, can check it by running this on R console.
+The easiest way to install JDK is using the new {rJavaEnv} package in R:
+# install.packages('rJavaEnv')
+
+# check version of Java currently installed (if any)
+rJavaEnv::java_check_version_rjava()
+
+# install Java 21
+rJavaEnv::java_quick_install(version = 21)
r5r
, as follows.
-# allocate RAM memory to Java
+# allocate RAM memory to Java **before** loading the {r5r} library
options(java.parameters = "-Xmx2G")
-# 1) build transport network, pointing to the path where OSM and GTFS data are stored
library(r5r)
+
+# 1) build transport network, pointing to the path where OSM and GTFS data are stored
path <- system.file("extdata/poa", package = "r5r")
r5r_core <- setup_r5(data_path = path, verbose = FALSE)
diff --git a/dev/pkgdown.yml b/dev/pkgdown.yml
index 66ae2aea..c800b17f 100644
--- a/dev/pkgdown.yml
+++ b/dev/pkgdown.yml
@@ -11,4 +11,4 @@ articles:
r5r: r5r.html
time_window: time_window.html
travel_time_matrix: travel_time_matrix.html
-last_built: 2024-07-19T04:28Z
+last_built: 2024-08-27T12:56Z
diff --git a/dev/reference/download_r5.html b/dev/reference/download_r5.html
index 2bdd6997..222a6181 100644
--- a/dev/reference/download_r5.html
+++ b/dev/reference/download_r5.html
@@ -134,8 +134,8 @@ Examples