# dataframe example
data(NOAA_df_1990)
library(dplyr)
Tmax <- filter(NOAA_df_1990, # subset the data
proc == "Tmax" & # extract max temperature
month %in% 5:9 & # May to July
year == 1993) # year 1993
Tmax$t <- Tmax$julian - min(Tmax$julian) + 1 # create a new time variable starting at 1
sp_df <- spatial_means(Tmax,
lat_col = "lat",
lon_col = "lon",
t_col = "t",
z_col = "z")
autoplot(sp_df)
# stars examples
library(stars)
tif = system.file("tif/olinda_dem_utm25s.tif", package = "stars")
x <- read_stars(tif)
sp_means <- spatial_means(x)
autoplot(sp_means)
Run the code above in your browser using DataLab