Title: | Precipitation R Recipes |
---|---|
Description: | An open-access tool/framework to download, validate, visualize, and analyze multi-source precipitation data. More information and an example of implementation can be found in Vargas Godoy and Markonis (2023, <doi:10.1016/j.envsoft.2023.105711>). |
Authors: | Mijael Rodrigo Vargas Godoy [aut, cre] , Yannis Markonis [aut, ths] |
Maintainer: | Mijael Rodrigo Vargas Godoy <[email protected]> |
License: | GPL-3 |
Version: | 3.0.2 |
Built: | 2024-12-07 20:35:30 UTC |
Source: | CRAN |
The function download_data
downloads the selected data product.
download_data( dataset = "all", path = ".", domain = "raw", timestep = "monthly" )
download_data( dataset = "all", path = ".", domain = "raw", timestep = "monthly" )
dataset |
a character string with the name(s) of the desired data set. Suitable options are:
|
path |
a character string with the path where the database will be downloaded. |
domain |
a character string with the desired domain data set. Suitable options are:
|
timestep |
a character string with the desired time resolution. Suitable options are:
|
No return value, called to download the required data sets.
download_data("gldas-vic", tempdir(), timestep = "yearly")
download_data("gldas-vic", tempdir(), timestep = "yearly")
Convenient and aesthetic visualization of data in a boxplot.
plot_box(x, var = "Precipitation", unit = "mm") ## S4 method for signature 'Raster' plot_box(x, var = "Precipitation", unit = "mm") ## S4 method for signature 'data.table' plot_box(x, var = "Precipitation", unit = "mm") ## S4 method for signature 'character' plot_box(x, var = "Precipitation", unit = "mm")
plot_box(x, var = "Precipitation", unit = "mm") ## S4 method for signature 'Raster' plot_box(x, var = "Precipitation", unit = "mm") ## S4 method for signature 'data.table' plot_box(x, var = "Precipitation", unit = "mm") ## S4 method for signature 'character' plot_box(x, var = "Precipitation", unit = "mm")
x |
Raster* object; data.table (see details); filename (character, see details) |
var |
character (see details) |
unit |
character (see details) |
If 'x' is a data.table, its columns should be named: "lon", "lat", "date", and "value"
If 'x' is a filename, it should point to a *.nc file.
'var' is a character string describing the variable to be used for the plot title
'unit' is a character string describing the unit of measurement to be used for the plot title
ggplot object
## Not run: download_data("gldas-vic", tempdir(), timestep = "yearly") r <- raster::brick(paste0(tempdir(), "/gldas-vic_tp_mm_land_194801_201412_025_yearly.nc")) s <- plot_box(r) ## End(Not run)
## Not run: download_data("gldas-vic", tempdir(), timestep = "yearly") r <- raster::brick(paste0(tempdir(), "/gldas-vic_tp_mm_land_194801_201412_025_yearly.nc")) s <- plot_box(r) ## End(Not run)
Convenient and aesthetic visualization of data in a histogram.
plot_density(x, var = "Precipitation", unit = "mm") ## S4 method for signature 'Raster' plot_density(x, var = "Precipitation", unit = "mm") ## S4 method for signature 'data.table' plot_density(x, var = "Precipitation", unit = "mm") ## S4 method for signature 'character' plot_density(x, var = "Precipitation", unit = "mm")
plot_density(x, var = "Precipitation", unit = "mm") ## S4 method for signature 'Raster' plot_density(x, var = "Precipitation", unit = "mm") ## S4 method for signature 'data.table' plot_density(x, var = "Precipitation", unit = "mm") ## S4 method for signature 'character' plot_density(x, var = "Precipitation", unit = "mm")
x |
Raster* object; data.table (see details); filename (character, see details) |
var |
character (see details) |
unit |
character (see details) |
If 'x' is a data.table, its columns should be named: "lon", "lat", "date", and "value"
If 'x' is a filename, it should point to a *.nc file.
'var' is a character string describing the variable to be used for the axis title
'unit' is a character string describing the unit of measurement to be used for the axis title
ggplot object
## Not run: download_data("gldas-vic", tempdir(), timestep = "yearly") r <- raster::brick(paste0(tempdir(), "/gldas-vic_tp_mm_land_194801_201412_025_yearly.nc")) s <- plot_density(r) ## End(Not run)
## Not run: download_data("gldas-vic", tempdir(), timestep = "yearly") r <- raster::brick(paste0(tempdir(), "/gldas-vic_tp_mm_land_194801_201412_025_yearly.nc")) s <- plot_density(r) ## End(Not run)
Convenient and aesthetic visualization of data in a heatmap.
plot_heatmap(x, unit = "mm") ## S4 method for signature 'Raster' plot_heatmap(x, unit = "mm") ## S4 method for signature 'data.table' plot_heatmap(x, unit = "mm") ## S4 method for signature 'character' plot_heatmap(x, unit = "mm")
plot_heatmap(x, unit = "mm") ## S4 method for signature 'Raster' plot_heatmap(x, unit = "mm") ## S4 method for signature 'data.table' plot_heatmap(x, unit = "mm") ## S4 method for signature 'character' plot_heatmap(x, unit = "mm")
x |
Raster* object; data.table (see details); filename (character, see details) |
unit |
character (see details) |
If 'x' is a data.table, its columns should be named: "lon", "lat", "date", and "value"
If 'x' is a filename, it should point to a *.nc file.
'unit' is a character string describing the unit of measurement to be used for the axis title
ggplot object
## Not run: download_data("gldas-vic", tempdir(), timestep = "yearly") r <- raster::brick(paste0(tempdir(), "/gldas-vic_tp_mm_land_194801_201412_025_yearly.nc")) s <- plot_heatmap(r) ## End(Not run)
## Not run: download_data("gldas-vic", tempdir(), timestep = "yearly") r <- raster::brick(paste0(tempdir(), "/gldas-vic_tp_mm_land_194801_201412_025_yearly.nc")) s <- plot_heatmap(r) ## End(Not run)
Convenient and aesthetic visualization of data in a line plot.
plot_line(x, var = "Precipitation", unit = "mm") ## S4 method for signature 'Raster' plot_line(x, var = "Precipitation", unit = "mm") ## S4 method for signature 'data.table' plot_line(x, var = "Precipitation", unit = "mm") ## S4 method for signature 'character' plot_line(x, var = "Precipitation", unit = "mm")
plot_line(x, var = "Precipitation", unit = "mm") ## S4 method for signature 'Raster' plot_line(x, var = "Precipitation", unit = "mm") ## S4 method for signature 'data.table' plot_line(x, var = "Precipitation", unit = "mm") ## S4 method for signature 'character' plot_line(x, var = "Precipitation", unit = "mm")
x |
Raster* object; data.table (see details); filename (character, see details) |
var |
character (see details) |
unit |
character (see details) |
If 'x' is a data.table, its columns should be named: "lon", "lat", "date", and "value"
If 'x' is a filename, it should point to a *.nc file.
'var' is a character string describing the variable to be used for the axis title
'unit' is a character string describing the unit of measurement to be used for the axis title
ggplot object
## Not run: download_data("gldas-vic", tempdir(), timestep = "yearly") r <- raster::brick(paste0(tempdir(), "/gldas-vic_tp_mm_land_194801_201412_025_yearly.nc")) s <- plot_line(r) ## End(Not run)
## Not run: download_data("gldas-vic", tempdir(), timestep = "yearly") r <- raster::brick(paste0(tempdir(), "/gldas-vic_tp_mm_land_194801_201412_025_yearly.nc")) s <- plot_line(r) ## End(Not run)
Convenient and aesthetic visualization of data in a map
plot_map(x, layer = 1, unit = "mm", timestamp = TRUE) ## S4 method for signature 'Raster' plot_map(x, layer = 1, unit = "mm", timestamp = TRUE) ## S4 method for signature 'data.table' plot_map(x, layer = 0, unit = "mm", timestamp = TRUE) ## S4 method for signature 'character' plot_map(x, layer = 1, unit = "mm", timestamp = TRUE)
plot_map(x, layer = 1, unit = "mm", timestamp = TRUE) ## S4 method for signature 'Raster' plot_map(x, layer = 1, unit = "mm", timestamp = TRUE) ## S4 method for signature 'data.table' plot_map(x, layer = 0, unit = "mm", timestamp = TRUE) ## S4 method for signature 'character' plot_map(x, layer = 1, unit = "mm", timestamp = TRUE)
x |
Raster* object; data.table (see details); filename (character, see details) |
layer |
numeric |
unit |
character |
timestamp |
logical |
If 'x' is a data.table, its columns should be named: "lon", "lat", "date", and "value"
If 'x' is a filename, it should point to a *.nc file.
'unit' is a character string describing the unit of measurement to be used for the legend title
'layer' is the layer number to be plotted.
‘timestamp' if TRUE (default) the plot title is the layer’s date
ggplot object
Convenient and aesthetic visualization of data in a summary plot.
plot_summary(x, var = "Precipitation", unit = "mm") ## S4 method for signature 'Raster' plot_summary(x, var = "Precipitation", unit = "mm") ## S4 method for signature 'data.table' plot_summary(x, var = "Precipitation", unit = "mm") ## S4 method for signature 'character' plot_summary(x, var = "Precipitation", unit = "mm")
plot_summary(x, var = "Precipitation", unit = "mm") ## S4 method for signature 'Raster' plot_summary(x, var = "Precipitation", unit = "mm") ## S4 method for signature 'data.table' plot_summary(x, var = "Precipitation", unit = "mm") ## S4 method for signature 'character' plot_summary(x, var = "Precipitation", unit = "mm")
x |
Raster* object; data.table (see details); filename (character, see details) |
var |
character (see details) |
unit |
character (see details) |
If 'x' is a data.table, its columns should be named: "lon", "lat", "date", and "value"
If 'x' is a filename, it should point to a *.nc file.
'var' is a character string describing the variable to be used for the axis title
'unit' is a character string describing the unit of measurement to be used for the axis title
ggplot object
## Not run: download_data("gldas-vic", tempdir(), timestep = "yearly") r <- raster::brick(paste0(tempdir(), "/gldas-vic_tp_mm_land_194801_201412_025_yearly.nc")) s <- plot_summary(r) ## End(Not run)
## Not run: download_data("gldas-vic", tempdir(), timestep = "yearly") r <- raster::brick(paste0(tempdir(), "/gldas-vic_tp_mm_land_194801_201412_025_yearly.nc")) s <- plot_summary(r) ## End(Not run)
Convenient and aesthetic visualization of data in a Taylor diagram.
plot_taylor(x, y, groups = "default", ...)
plot_taylor(x, y, groups = "default", ...)
x |
data.table |
y |
data.table |
groups |
character |
... |
see details |
'x' columns should be named: "lon", "lat", "date", "value", "dataset", and "source".
'y' columns should be named: "lon", "lat", "date", "value", "dataset", and "source".
'groups' character to define panels. Suitable options are:
"default" (only one panel)
"source"
"seasons" (only works properly with monthly data)
'...' extra arguments passed on to openair::TaylorDiagram
plot object