From 4ad8433e53df6d5ea58820e5efce66d09f9ed15d Mon Sep 17 00:00:00 2001 From: Robin Lovelace Date: Tue, 10 Sep 2024 13:10:51 +0100 Subject: [PATCH] Update R installation instructions, close #71 (#72) --- r/README.md | 15 ++++++++++----- r/README.qmd | 15 ++++++++++----- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/r/README.md b/r/README.md index 1bd6a25..f872f7d 100644 --- a/r/README.md +++ b/r/README.md @@ -4,6 +4,16 @@ This R package provides functions to prepare OD data for network generation with the `od2net` tool, as illustrated in the example below. +## Installation + +``` r +# Install pak if not already installed: +if (!requireNamespace("pak", quietly = TRUE)) { + install.packages("pak") +} +pak::pkg_install("Urban-Analytics-Technology-Platform/od2net/r") +``` + ## Example Imagine you want to generate a route network with values on the links @@ -78,11 +88,6 @@ make_elevation = function( ``` r -# Install pak if not already installed: -if (!requireNamespace("pak", quietly = TRUE)) { - install.packages("pak") -} -pak::pkg_install("robinlovelace/od2net/r@67-r-port") dir.create("input", showWarnings = FALSE) # Get some zones from a URL: uz = "https://github.com/acteng/netgen/raw/main/input/zones_york.geojson" diff --git a/r/README.qmd b/r/README.qmd index e0a80e4..0cd7323 100644 --- a/r/README.qmd +++ b/r/README.qmd @@ -10,6 +10,16 @@ execute: This R package provides functions to prepare OD data for network generation with the `od2net` tool, as illustrated in the example below. +## Installation + +```{r} +# Install pak if not already installed: +if (!requireNamespace("pak", quietly = TRUE)) { + install.packages("pak") +} +pak::pkg_install("Urban-Analytics-Technology-Platform/od2net/r") +``` + ## Example Imagine you want to generate a route network with values on the links representing the number of pupils/parents on their way to school each school day. The following code shows how to prepare the data for the `od2net` tool. @@ -83,11 +93,6 @@ make_elevation = function( ```{r} #| eval: false -# Install pak if not already installed: -if (!requireNamespace("pak", quietly = TRUE)) { - install.packages("pak") -} -pak::pkg_install("robinlovelace/od2net/r@67-r-port") dir.create("input", showWarnings = FALSE) # Get some zones from a URL: uz = "https://github.com/acteng/netgen/raw/main/input/zones_york.geojson"