Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update R installation instructions, close #71 #72

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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