if (FALSE) {
destination <- tempfile("copernicus", fileext = ".nc")
## Assuming that Copernicus account details are provided as `options`
cms_download_subset(
destination = destination,
product = "GLOBAL_ANALYSISFORECAST_PHY_001_024",
layer = "cmems_mod_glo_phy-cur_anfc_0.083deg_P1D-m",
variable = "sea_water_velocity",
region = c(-1, 50, 10, 55),
timerange = c("2021-01-01 UTC", "2021-01-02 UTC"),
verticalrange = c(0, -2)
)
mydata <- stars::read_stars(destination)
plot(mydata["vo"])
}
Run the code above in your browser using DataLab