Skip to content

Commit

Permalink
updated vignette, since sf does not prepend ".data" any longer?
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinHinz committed Nov 29, 2024
1 parent 8709075 commit fbbf9af
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vignettes/simple_plotting.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,15 @@ adrac_sf <- adrac %>% as.sf()
This tabular data structure contains the spatial point information for each date in a column *geom*, but also the initial columns of the input dataset: *data.\**

```{r, echo=FALSE}
adrac_sf %>% dplyr::select(data.labnr, data.c14age, data.c14std, geom)
adrac_sf %>% dplyr::select(labnr, c14age, c14std, geom)
```

It can be manipulated with the powerful dplyr functions. We `filter` out all dates from one particular publication (*Moga 2008*), `group` the dates `by` *site* and apply the `summarise` command to keep only one value per group. As we do not define an operation to fold the other variables in the input table, they are removed. Only the geometry column remains.

```{r}
Moga_spatial <- adrac_sf %>%
dplyr::filter(grepl("Moga 2008", data.shortref)) %>%
dplyr::group_by(data.site) %>%
dplyr::filter(grepl("Moga 2008", shortref)) %>%
dplyr::group_by(site) %>%
dplyr::summarise(.groups = "drop")
```

Expand Down

0 comments on commit fbbf9af

Please sign in to comment.