Skip to content

Commit

Permalink
update to setup-pandoc@v2
Browse files Browse the repository at this point in the history
  • Loading branch information
rafapereirabr committed Jun 9, 2023
1 parent 772f900 commit 27882a6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- uses: r-lib/actions/setup-r@v2
id: install-r

- uses: r-lib/actions/setup-pandoc@v1
- uses: r-lib/actions/setup-pandoc@v2

- name: Install pak and query dependencies
run: |
Expand Down
10 changes: 8 additions & 2 deletions vignettes/uci.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ remotes::install_github("ipeaGIT/uci")

# Demonstration on sample data

First, let's load a few libraries we'll be using in this vignette.

```{r, message = FALSE, warning = FALSE}
library(uci)
library(sf)
Expand All @@ -39,15 +41,19 @@ library(ggplot2)

## Data input

text
The **uci** package comes with a sample data for demonstration and test purposes. The data is a small sample of the spatial distribution of the population, jobs and schools around the city center of Belo Horizonte, Brazil. This sample data set is a good illustration of the type of data input required by **uci**.

Here is how the sample data looks like:

```{r}
data_dir <- system.file("extdata", package = "uci")
grid <- readRDS(file.path(data_dir, "grid_bho.rds"))
head(grid)
```
text
The data is an object of class `"sf" "data.frame"` with spatial polygons covering our study area and a few columns indicating the number of activities (e.g. jobs, schools, population) in each polygon. Our particular sample data is based on a spatial hexagonal grid (H3 index). While there are advantages of using regular spatial grids to calculate spatial statistics, **uci** also works with non-regular geometris, such as census tracts, enumeration areas or municipalities.

We can visualize the spatial distribution of jobs using `ggplot2`:

```{r, eval = requireNamespace(c("sf", "ggplot2"), quietly = TRUE), out.width = "80%", fig.width = 6, fig.height = 6}
Expand Down

0 comments on commit 27882a6

Please sign in to comment.