devtools::install_github("https://github.com/kazivana/precipmodeling.git")
library(precipmodeling) library(data.table) library(ncdf4) library(sp) library(rgdal) library(raster) library(ggplot2)
Includes dates, precipitation and model name (forcing) columns
dta <- readRDS('C:/Users/godzi/Documents/avancedr/precip/CZ_pr_EUR-11_CNRM-CERFACS-CNRM-CM5_historical_r1i1p1_CNRM-ALADIN63_v2_1hr.rds')
Get Maxima values for Precipitation from dta dataset
head(getMX(dta, a = c(1,2,3,6,12,24)))
Using function to split the dataset for hourly duration and frequency for DDF curves
ddff(dta, frequency = c(2,5,10,20))
Plotting aggregated maximum depths of multiple models
ggplot(depth_maxima) + geom_line(aes(x = hour, y = depth, col = RCM, lty = GCM)) + facet_grid(factor(freq) ~ RCP)
fls <- list.files(path = "C:/Users/godzi/Documents/avancedr/spatial/data/raw_short", pattern = ".nc", full.names = TRUE)
Plotting hourly precipitation data
a = allprecip(fls[1]) plot(a)
Plotting precipitation data with Prague geospatial data visualization
singleprecip(fls[1], 1)
The change in historical and future projected precipitation based on "IPSL-IPSL-CM5A-MR" GLobal Climate Model
ggplot(delta[GCM == "IPSL-IPSL-CM5A-MR", .(hour, delta, freq, RCP, RCM)]) + geom_line(aes(x = hour, y = delta, col = factor(freq), lty = RCM)) + facet_grid(.~RCP)
Returns a dataframe with date, precipitation, latitute, longitute and model name, aggregated from multiple datasets
r = getPrecipDF(fls) r
precip
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.