mk_mth <- function(x) {
## replace daily with month
xx <- stringr::str_replace(x, "daily", "month")
## replace _YEAR with mth_YEAR
stringr::str_replace(xx, "(_[0-9]{4})", "_mth\\1")
}
library(bluelink)
dsn <- mk_mth(bluelink_dsn("2024-01-01", varname = "ocean_temp"))
terra::rast(dsn)
class : SpatRaster
size : 1500, 3600, 51 (nrow, ncol, nlyr)
resolution : 0.1, 0.1 (x, y)
extent : -9.507305e-10, 360, -75, 75 (xmin, xmax, ymin, ymax)
coord. ref. :
source : ocean_temp_mth_2024_01.nc:temp
varname : temp (Potential temperature)
names : temp_~n=2.5, temp_~n=7.5, temp_~=12.5, temp_~11816, temp_~72949, temp_~98828, ...
unit : degrees C
depth : 16451.5