library(dplyr)
# Dataframe example
data(NOAA_df_1990)
Tmax <- filter(NOAA_df_1990,
proc == "Tmax" &
month == 5 &
year == 1993 &
id < 4000)
Tmax$t <- Tmax$julian - min(Tmax$julian) + 1
Tmax_days <- subset(Tmax, t %in% c(1, 15))
spatial_snapshots(Tmax_days,
lat_col = 'lat',
lon_col = 'lon',
t_col = 't',
z_col = 'z',
title = "Maximum Temperature for 2 days ")
# stars example
library(stars)
tif = system.file("tif/L7_ETMs.tif", package = "stars")
x <- read_stars(tif)
x2 <- x %>% slice(band, 1:2)
spatial_snapshots(x2)
Run the code above in your browser using DataLab