knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(rainfallR) library(iffitoR) library(tidyverse) library(scales) library(stars) library(ncdf4)
# the path to the netcdf path_data = "\\\\projectdata.eurac.edu/projects/Proslide/PREC_GRIDS_updated/" # set the day you want the data day = as.Date("2016-08-16") # days back days_back = 2
# this will return a list of paths. One for each month of data that we need paths = rainfallR::get_nc_paths(path_data, day, days_back)
# open the data as ncdf4 object ncin = ncdf4::nc_open(paths[[1]]) # read it into a stars object ncin_stars = read_ncdf(paths[[1]])
ncin_stars
# get the dimensions dimensions = st_dimensions(ncin_stars) # get the values of the only attribute # this is a 3d-array values = ncin_stars$precipitation
# get the 16th day single_day = ncin_stars[,,,16] st_dimensions(single_day)
# plot(single_day, main="Precipation on the 16th of August 2016")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.