From 7a3d61f486e14a830b996d33f84e10d16f1cb256 Mon Sep 17 00:00:00 2001 From: David LeBauer Date: Mon, 12 Dec 2022 16:13:44 -0700 Subject: [PATCH 1/4] Update README.md install datasets --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 654dc72..feae039 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,13 @@ **downscaleR** is an R package for empirical-statistical downscaling focusing on daily data and covering the most popular approaches (bias correction, Model Output Statistics, Perfect Prognosis) and techniques (e.g. quantile mapping, regression, analogs, neural networks). This package has been conceived to work in the framework of both seasonal forecasting and climate change studies. Thus, it considers ensemble members as a basic dimension of the data structure. Find out more about this package at the [downscaleR wiki](https://github.com/SantanderMetGroup/downscaleR/wiki). -This package is part of the [climate4R bundle](http://www.meteo.unican.es/climate4r), formed by `loadeR`, `transformeR`, `downscaleR` and `visualizeR`. The recommended installation procedure is to use the `install_github` command from the devtools R package: +This package is part of the [climate4R bundle](http://www.meteo.unican.es/climate4r), formed by `loadeR`, `transformeR`, `downscaleR` and `visualizeR`. There is also a "climate4R.datasets" package that provides datasets used in the examples below. +The recommended installation procedure is to use the `install_github` command from the devtools R package: ```r -devtools::install_github(c("SantanderMetGroup/transformeR", "SantanderMetGroup/downscaleR")) +devtools::install_github(c("SantanderMetGroup/transformeR", + "SantanderMetGroup/downscaleR", + "SantanderMetGroup/climate4R.datasets")) ``` **NOTE:** Note that `transformeR` is a dependency for `downscaleR`. The utilities in `transformeR` were formerly part of `downscaleR` (up to v1.3-4). Since `downscaleR` v2.0-0, these are in `transformeR` and `downscaleR` is strictly aimed to statistical downscaling. Note that `transformeR` also includes illustrative datasets for the `climate4r`framework. From 0799f77e2310e4d0ab1bafa212e8cba287aabc18 Mon Sep 17 00:00:00 2001 From: David LeBauer Date: Mon, 12 Dec 2022 16:19:08 -0700 Subject: [PATCH 2/4] update downscale.train to new function name downscaleTrain per https://github.com/SantanderMetGroup/downscaleR/blob/67f40511c399082e0f604b6f7d51a14568e5512a/NEWS#L49 --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index feae039..6d79b32 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ devtools::install_github(c("SantanderMetGroup/transformeR", **EXAMPLE:** The following code trains three different downscaling methods (analogs, linear regression and neural networks) using principal components (explaining 95\% of the variance for each variable) and visualizes the results (the illustrative station and reanalysis data for DJF included in the `transformeR` package is used in this example): ```r library(downscaleR) +library(climate4R.datasets) data("VALUE_Iberia_tas") # illustrative datasets included in transformeR y <- VALUE_Iberia_tas data("NCEP_Iberia_hus850", "NCEP_Iberia_psl", "NCEP_Iberia_ta850") @@ -24,9 +25,9 @@ x <- makeMultiGrid(NCEP_Iberia_hus850, NCEP_Iberia_psl, NCEP_Iberia_ta850) # calculating predictors data <- prepareData(x = x, y = y,spatial.predictors = list(v.exp = 0.95)) # Fitting statistical downscaling methods (simple case, no cross-validation) -analog <- downscale.train(data, method = "analogs", n.analogs = 1) -regression <- downscale.train(data, method = "GLM",family = gaussian) -neuralnet <- downscale.train(data, method = "NN", hidden = c(10,5), output = "linear") +analog <- downscaleTrain(data, method = "analogs", n.analogs = 1) +regression <- downscaleTrain(data, method = "GLM",family = gaussian) +neuralnet <- downscaleTrain(data, method = "NN", hidden = c(10,5), output = "linear") # Extracting the results for a particula station (Igueldo) for a single year (2000) igueldo.2000 <- subsetGrid(y,station.id = "000234",years = 2000) analog.2000 <- subsetGrid(analog$pred,station.id = "000234",years = 2000) From f992408df17ba5bb122a653aaebd2c0fdb90c976 Mon Sep 17 00:00:00 2001 From: David LeBauer Date: Mon, 12 Dec 2022 16:22:18 -0700 Subject: [PATCH 3/4] install visualizeR --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6d79b32..038144d 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,9 @@ This package is part of the [climate4R bundle](http://www.meteo.unican.es/climat The recommended installation procedure is to use the `install_github` command from the devtools R package: ```r -devtools::install_github(c("SantanderMetGroup/transformeR", +remotes::install_github(c("SantanderMetGroup/transformeR", "SantanderMetGroup/downscaleR", + "SantanderMetGroup/visualizeR", "SantanderMetGroup/climate4R.datasets")) ``` **NOTE:** Note that `transformeR` is a dependency for `downscaleR`. The utilities in `transformeR` were formerly part of `downscaleR` (up to v1.3-4). Since `downscaleR` v2.0-0, these are in `transformeR` and `downscaleR` is strictly aimed to statistical downscaling. Note that `transformeR` also includes illustrative datasets for the `climate4r`framework. @@ -22,17 +23,22 @@ data("VALUE_Iberia_tas") # illustrative datasets included in transformeR y <- VALUE_Iberia_tas data("NCEP_Iberia_hus850", "NCEP_Iberia_psl", "NCEP_Iberia_ta850") x <- makeMultiGrid(NCEP_Iberia_hus850, NCEP_Iberia_psl, NCEP_Iberia_ta850) + # calculating predictors data <- prepareData(x = x, y = y,spatial.predictors = list(v.exp = 0.95)) + # Fitting statistical downscaling methods (simple case, no cross-validation) analog <- downscaleTrain(data, method = "analogs", n.analogs = 1) regression <- downscaleTrain(data, method = "GLM",family = gaussian) neuralnet <- downscaleTrain(data, method = "NN", hidden = c(10,5), output = "linear") + # Extracting the results for a particula station (Igueldo) for a single year (2000) igueldo.2000 <- subsetGrid(y,station.id = "000234",years = 2000) analog.2000 <- subsetGrid(analog$pred,station.id = "000234",years = 2000) regression.2000 <- subsetGrid(regression$pred,station.id = "000234",years = 2000) neuralnet.2000 <- subsetGrid(neuralnet$pred,station.id = "000234",years = 2000) + + library(visualizeR) # Data visualization utilities temporalPlot(igueldo.2000, analog.2000, regression.2000, neuralnet.2000) ``` From 7f770854b35f440e7127e9f566e3ce295f1ce7cf Mon Sep 17 00:00:00 2001 From: David LeBauer Date: Mon, 12 Dec 2022 16:23:01 -0700 Subject: [PATCH 4/4] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 038144d..49bdae9 100644 --- a/README.md +++ b/README.md @@ -38,8 +38,8 @@ analog.2000 <- subsetGrid(analog$pred,station.id = "000234",years = 2000) regression.2000 <- subsetGrid(regression$pred,station.id = "000234",years = 2000) neuralnet.2000 <- subsetGrid(neuralnet$pred,station.id = "000234",years = 2000) - -library(visualizeR) # Data visualization utilities +# Data visualization utilities +library(visualizeR) temporalPlot(igueldo.2000, analog.2000, regression.2000, neuralnet.2000) ```