Skip to content

Commit

Permalink
Update R installation instructions, close #71 (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
Robinlovelace authored Sep 10, 2024
1 parent 27fff32 commit 4ad8433
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
15 changes: 10 additions & 5 deletions r/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -78,11 +88,6 @@ make_elevation = function(
</details>

``` 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"
Expand Down
15 changes: 10 additions & 5 deletions r/README.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 4ad8433

Please sign in to comment.