if (requireNamespace("sf", quietly = TRUE)) {
library(sf)
summary(nz_height)
plot(nz$geom)
plot(nz_height$geom, add = TRUE)
}
if (FALSE) {
library(dplyr)
# After downloading data
unzip("lds-nz-height-points-topo-150k-SHP.zip")
nz_height = st_read("nz-height-points-topo-150k.shp") %>%
top_n(n = 100, wt = elevation)
library(tmap)
tmap_mode("view")
qtm(nz) +
qtm(nz_height)
f = list.files(pattern = "*nz-height*")
file.remove(f)
}
Run the code above in your browser using DataLab