File: sf6.R

package info (click to toggle)
r-cran-sf 1.0-19%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 7,236 kB
  • sloc: cpp: 7,200; sh: 19; makefile: 2
file content (22 lines) | stat: -rw-r--r-- 752 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
## ----echo=FALSE, include=FALSE------------------------------------------------
knitr::opts_chunk$set(fig.height = 4.5)
knitr::opts_chunk$set(fig.width = 6)
knitr::opts_chunk$set(collapse = TRUE)

## -----------------------------------------------------------------------------
library(sf)
demo(nc, ask = FALSE, echo = FALSE)
nc$geom2 = st_centroid(st_geometry(nc))
print(nc, n = 2)

## -----------------------------------------------------------------------------
plot(st_geometry(nc))
st_geometry(nc) <- "geom2"
plot(st_geometry(nc))

## ----eval=FALSE---------------------------------------------------------------
#  i = sf::st_intersects(sf1, sf2)

## ----eval=FALSE---------------------------------------------------------------
#  library(sf)