forked from r-spatial/stars
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plot.R
20 lines (18 loc) · 784 Bytes
/
plot.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
library(spacetime)
suppressPackageStartupMessages(library(stars))
data(air) # this loads several datasets in .GlobalEnv
dim(air)
d = st_dimensions(station = st_as_sfc(stations), time = dates)
aq = st_as_stars(list(PM10 = air), dimensions = d)
image(aperm(log(aq), 2:1), main = "NA pattern (white) in PM10 station time series")
st_geometry(aq)
csv = system.file("tif/ESACCI-LC-Legend.csv", package = "starsdata")
if (csv != "") {
rgb = read.csv(csv, header = TRUE, sep = ";")
luc = read_stars(system.file("tif/LUC3.tif", package = "starsdata"))
plot(luc, rgb = rgb, axes = TRUE, key.pos = NULL)
}
# https://github.com/r-spatial/stars/issues/233 :
nc = read_sf(system.file("shape/nc.shp", package = "sf"))
output = st_as_stars(st_bbox(nc), nx = 1, ny = 1, values = 1)
plot(output)