Title: | Bioclimatic Analysis and Classification |
---|---|
Description: | Using numeric or raster data, this package contains functions to calculate: complete water balance, bioclimatic balance, bioclimatic intensities, reports for individual locations, multi-layered rasters for spatial analysis. |
Authors: | Roberto Serrano-Notivoli |
Maintainer: | Roberto Serrano-Notivoli <[email protected]> |
License: | GPL-3 |
Version: | 0.4.0 |
Built: | 2024-12-25 06:30:55 UTC |
Source: | CRAN |
A SpatRaster containing the bioclimatic balance of the Alps.
bbRast
bbRast
A PackedSpatRaster with 12 monthly values of 4 variables:
B
, b
, bc
and bl
.
Computes bioclimatic balance from water balance.
biobal(balhid, CC)
biobal(balhid, CC)
balhid |
Water balance. |
CC |
Field capacity. It depends on water retention capacity and depth of roots. 400 as default value. |
data frame with 12 variables: 'p', 'Tm', 'PET', 'e', 'D', 'S', 'Cd', 'T_75', 'B', 'b', 'bl', 'bc'.
wb <- watbal(t = rnorm(12, 18, 6), p = rnorm(12, 50, 30), lat = 35, CC = 400) biobal(wb, 400)
wb <- watbal(t = rnorm(12, 18, 6), p = rnorm(12, 50, 30), lat = 35, CC = 400) biobal(wb, 400)
Computes bioclimatic balance from water balance in raster format.
biobalRaster(bh, CC, path = NULL, ncpu = 1)
biobalRaster(bh, CC, path = NULL, ncpu = 1)
bh |
Water balance in raster format. |
CC |
Field capacity. It depends on water retention capacity and depth of roots. 400 as default value. It can be a SpatRaster layer. |
path |
Optional. Path (folder) where the output raster files and look-up-tables will be saved. |
ncpu |
Number of CPUs to use. By default, sequential mode (1 cpu) is used. |
SpatRaster with 48 layers corresponding to the 12 monthly values of 'B', 'b','bc','bl'.
wb <- terra::rast(wbRast) bb <- biobalRaster(wb, CC = 400, path=NULL, ncpu = 2)
wb <- terra::rast(wbRast) bb <- biobalRaster(wb, CC = 400, path=NULL, ncpu = 2)
This function creates a complete report for a specific location, from temperature and precipitation data series.
bioclim_report(t, p, nam, lat, CC, output)
bioclim_report(t, p, nam, lat, CC, output)
t |
Monthly average temperature data (12 nueric values). |
p |
Monthly average precipitation data (12 nueric values). |
nam |
Name of the location. It will be used as name of output file |
lat |
Latitude in degrees. For southern latitudes use negative values. |
CC |
Field capacity. It depends on water retention capacity and depth of roots. Use 400 as default value. |
output |
Path of the output pdf file. |
data frame with 20 variables: 'p', 'Tm', 'PET', 'e', 'D', 'S', 's_e_D', 'sum_s', 'c_D_e', 'sum_c', 'Q', 'x', 'E_e', 'D_e', 'Cd', 'T_75', 'B', 'b', 'bl', 'bc'.
bioclim_report(t = c(10, 11.5, 14, 16.5, 20, 24.5, 27.5, 28, 24.5, 19.5, 14.5, 11), p = c(55, 73, 84, 58, 33, 23, 2, 2, 28, 66, 94, 71), lat = 35, nam = 'Seville', CC = 400, output ='./seville.pdf')
bioclim_report(t = c(10, 11.5, 14, 16.5, 20, 24.5, 27.5, 28, 24.5, 19.5, 14.5, 11), p = c(55, 73, 84, 58, 33, 23, 2, 2, 28, 66, 94, 71), lat = 35, nam = 'Seville', CC = 400, output ='./seville.pdf')
Computes bioclimatic intensities from bioclimatic balance.
bioint(bb)
bioint(bb)
bb |
Bioclimatic balance. |
The function yields 10 variables at monthly scale corresponding with the warm (w) and cold (c) variants of 5 bioclimatic intensities: PBI (Potential bioclimatic intensity), RBI (Real bioclimatic intensity), CBI (Conditioned bioclimatic intensity), FBI (Free bioclimatic intensity), and DBI (Dry bioclimatic intensity).
data.frame with 10 variables. See details.
wb <- watbal(t = rnorm(12, 18, 6), p = rnorm(12, 50, 30), lat = 35, CC = 400) bb <- biobal(wb, 400) bi <- bioint(bb)
wb <- watbal(t = rnorm(12, 18, 6), p = rnorm(12, 50, 30), lat = 35, CC = 400) bb <- biobal(wb, 400) bi <- bioint(bb)
Computes bioclimatic intensities from bioclimatic balance.
biointRaster(bb, path = NULL)
biointRaster(bb, path = NULL)
bb |
Bioclimatic balance in raster format. |
path |
Optional. Path (folder) where the output raster files will be saved. |
SpatRaster with 120 layers corresponding to the 12 monthly values of "IBPc","IBCc","IBLc","IBRc","IBSc","IBPf","IBCf","IBLf","IBRf","IBSf".
bb <- terra::rast(bbRast) bi <- biointRaster(bb, path=NULL)
bb <- terra::rast(bbRast) bi <- biointRaster(bb, path=NULL)
Calculates bioclimatic classification based on bioclimatic balance.
biotype(t = NULL, p = NULL, lat = NULL, wb = NULL, bb = NULL, CC = NULL, mode)
biotype(t = NULL, p = NULL, lat = NULL, wb = NULL, bb = NULL, CC = NULL, mode)
t |
Numeric. Monthly temperature required for water balance calculation. |
p |
Numeric. Monthly precipitation required for water balance calculation. |
lat |
Numeric. Latitude required for water balance calculation. |
wb |
Water balance in data.frame format from watbal() function. If provided, 't' and 'p' are not used. |
bb |
Bioclimatic balancein data.frame format from biobal() function. If provided, 't', 'p' and 'wb' are not used. |
CC |
Field capacity. It depends on water retention capacity and depth of roots. 400 as default value. |
mode |
Type of output: "TBR", "sub", or "zonal". See details. |
Argument "mode" defines the type of return ("TBR": Types of Bioclimatic Regime; "zonal": zonal units; "sub": bioclimatic regime subtypes)
character defining the type of climate.
# calculation of water balance wb <- watbal(t = rnorm(12, 18, 6), p = rnorm(12, 50, 30), lat = 35, CC = 400) # calculation of bioclimatic balance bb <- biobal(wb, 400) # bioclimatic classification at TBR levels biotype(bb = bb, mode = 'TBR') # bioclimatic classification at zonal levels biotype(bb = bb, mode = 'zonal') # bioclimatic classification at subtypes levels (requires water balance) wb <- watbal(t = rnorm(12, 18, 6), p = rnorm(12, 50, 30), lat = 35, CC = 400) biotype(wb = wb, CC = 400, mode = 'sub')
# calculation of water balance wb <- watbal(t = rnorm(12, 18, 6), p = rnorm(12, 50, 30), lat = 35, CC = 400) # calculation of bioclimatic balance bb <- biobal(wb, 400) # bioclimatic classification at TBR levels biotype(bb = bb, mode = 'TBR') # bioclimatic classification at zonal levels biotype(bb = bb, mode = 'zonal') # bioclimatic classification at subtypes levels (requires water balance) wb <- watbal(t = rnorm(12, 18, 6), p = rnorm(12, 50, 30), lat = 35, CC = 400) biotype(wb = wb, CC = 400, mode = 'sub')
Calculates bioclimatic classification based on bioclimatic balance.
biotypeRaster( temp = NULL, prec = NULL, CC = NULL, path = NULL, ncpu = 1, PET = NULL, bh = NULL )
biotypeRaster( temp = NULL, prec = NULL, CC = NULL, path = NULL, ncpu = 1, PET = NULL, bh = NULL )
temp |
SpatRaster object with 12 layers representing temperature from January to December. |
prec |
SpatRaster object with 12 layers representing precipitation from January to December. |
CC |
Field capacity. It can be numeric (1 value) or a SpatRaster object. |
path |
Optional. Path (folder) where the output raster files and look-up-tables will be saved. |
ncpu |
number of cores to use in calculation. If not provided, sequential mode is used (1 core). |
PET |
Potential evapotranspiration. Optional. It must be a SpatRaster object. |
bh |
Water balance. Optional. It must be a SpatRaster object. |
SpatRaster with 3 variables ("TBR": Types of Bioclimatic Regime; "zonal": zonal units; "sub": bioclimatic regime subtypes).
wb <- terra::rast(wbRast) btr <- biotypeRaster(bh = wb)
wb <- terra::rast(wbRast) btr <- biotypeRaster(bh = wb)
This function calculates Thornthwaite’s index to refine the bioclimatic classification.
ith(bh)
ith(bh)
bh |
Water balance in data.frame format from watbal() function. |
Character, describing the humid characteristics of the climate.
wb <- watbal(t = rnorm(12, 18, 6), p = rnorm(12, 50, 30), lat = 35, CC = 400) ith(wb)
wb <- watbal(t = rnorm(12, 18, 6), p = rnorm(12, 50, 30), lat = 35, CC = 400) ith(wb)
This function calculates Thornthwaite’s index to refine the bioclimatic classification.
ithRaster(bh)
ithRaster(bh)
bh |
Water balance in SpatRaster format from watbalRaster() function. |
Numeric, describing the humid characteristics of the climate. 1: 'HyperArid', 2: 'Arid', 3: 'Semiarid', 4: 'Dry humid', 5: 'Moist humid', 6 'Low humid', 7: 'Moderate humid', 8: 'Highly humid', 9: 'Very humid', 10: 'Perhumid'.
wb <- terra::rast(wbRast) itr <- ithRaster(wb)
wb <- terra::rast(wbRast) itr <- ithRaster(wb)
Function to plot bioclimatic balance.
plotBiobal(intens)
plotBiobal(intens)
intens |
bioclimatic intensities in data.frame format from bioint() function. |
Plot of bioclimatic balance
wb <- watbal(t = c(10, 11.5, 14, 16.5, 20, 24.5, 27.5, 28, 24.5, 19.5, 14.5, 11), p = c(55, 73, 84, 58, 33, 23, 2, 2, 28, 66, 94, 71), lat = 35, CC = 400) bb <- biobal(wb, 400) bi <- bioint(bb) plotBiobal(bi)
wb <- watbal(t = c(10, 11.5, 14, 16.5, 20, 24.5, 27.5, 28, 24.5, 19.5, 14.5, 11), p = c(55, 73, 84, 58, 33, 23, 2, 2, 28, 66, 94, 71), lat = 35, CC = 400) bb <- biobal(wb, 400) bi <- bioint(bb) plotBiobal(bi)
Function to plot water balance.
plotWatbal(bh)
plotWatbal(bh)
bh |
Water balance in data.frame format from watbal() function. |
Plot of water balance
wb <- watbal(t = c(10, 11.5, 14, 16.5, 20, 24.5, 27.5, 28, 24.5, 19.5, 14.5, 11), p = c(55, 73, 84, 58, 33, 23, 2, 2, 28, 66, 94, 71), lat = 35, CC = 400) plotWatbal(wb)
wb <- watbal(t = c(10, 11.5, 14, 16.5, 20, 24.5, 27.5, 28, 24.5, 19.5, 14.5, 11), p = c(55, 73, 84, 58, 33, 23, 2, 2, 28, 66, 94, 71), lat = 35, CC = 400) plotWatbal(wb)
Function to plot Walter and Lieth diagram.
plotWL(t, p)
plotWL(t, p)
t |
Monthly average temperature data (12 nueric values). |
p |
Monthly average precipitation data (12 nueric values). |
Plot of Walter and Lieth diagram
plotWL(t = rnorm(12, 18, 6), p = rnorm(12, 50, 30))
plotWL(t = rnorm(12, 18, 6), p = rnorm(12, 50, 30))
Computes Positive Temperature index from monthly temperature.
postemp(t)
postemp(t)
t |
Monthly average temperature data (12 nueric values). |
Positive Temperature index
postemp(rnorm(12, 18, 6))
postemp(rnorm(12, 18, 6))
A SpatRaster containing the monthly precipitation of the Alps.
preRast
preRast
A PackedSpatRaster with 12 monthly values precipitation:
Computes Compensated Thermal Index from monthly temperature.
thermind(t)
thermind(t)
t |
Monthly average temperature data (12 nueric values). |
Compensated Thermal Index
thermind(rnorm(12, 18, 6))
thermind(rnorm(12, 18, 6))
This function calculates Thornthwaite’s potential evapotranspiration.
thornthwaite(Tave, lat, na.rm = FALSE)
thornthwaite(Tave, lat, na.rm = FALSE)
Tave |
a numeric vector, matrix or time series of monthly mean temperatures, ºC. |
lat |
a numeric vector with the latitude of the site or sites, in degrees. |
na.rm |
optional, a logical value indicating whether NA values should be stripped from the computations. |
This function is a modified version of SPEI::thornthwaite() function.
A time series with the values of monthly potential or reference evapotranspiration, in mm. If the input is a matrix or a multivariate time series each column will be treated as independent data (e.g., diferent observatories), and the output will be a multivariate time series.
Santiago Begueria
thornthwaite(rnorm(12, 18, 6), 35)
thornthwaite(rnorm(12, 18, 6), 35)
A SpatRaster containing the monthly temperature of the Alps.
tmpRast
tmpRast
A PackedSpatRaster with 12 monthly values temperature:
Computes water balance from temperature and precipitation data.
watbal(t, p, lat, CC)
watbal(t, p, lat, CC)
t |
Monthly average temperature data (12 nueric values). |
p |
Monthly average precipitation data (12 nueric values). |
lat |
Latitude in degrees. For southern latitudes use negative values. |
CC |
Field capacity. It depends on water retention capacity and depth of roots. Use 400 as default value. |
data frame with 12 variables: 'Tmp', 'Pcp', 'PET', 'P_PET', 'ppa', 'ST', 'i_ST', 'ETR', 'Dh', 'S', 'r', 'rP'.
watbal(t = rnorm(12, 18, 6), p = rnorm(12, 50, 30), lat = 35, CC = 400)
watbal(t = rnorm(12, 18, 6), p = rnorm(12, 50, 30), lat = 35, CC = 400)
Computes water balance from temperature and precipitation in raster format.
watbalRaster(temp, prec, PET = NULL, CC, path = NULL, ncpu = 2)
watbalRaster(temp, prec, PET = NULL, CC, path = NULL, ncpu = 2)
temp |
SpatRaster containing 12 layers with monthly temperature from January to December. |
prec |
SpatRaster containing 12 layers with monthlyprecipitation from January to December. |
PET |
Optional. Potential evapotranspiration in raster format. |
CC |
Field capacity. It depends on water retention capacity and depth of roots. 400 as default value. It can be a SpatRaster layer. |
path |
Optional. Path (folder) where the output raster files and look-up-tables will be saved. |
ncpu |
Number of cores used for the most demanding calculations. |
SpatRaster with 144 layers corresponding to the 12 monthly values of 'temp', 'prec','PET','P_PET','PPA','ST','i_ST','RET','HD','HEX','r','rP'.
tmp <- terra::rast(tmpRast) pre <- terra::rast(preRast) wb <- watbalRaster(tmp, pre, PET = NULL, CC = 400, path=NULL, ncpu = 2)
tmp <- terra::rast(tmpRast) pre <- terra::rast(preRast) wb <- watbalRaster(tmp, pre, PET = NULL, CC = 400, path=NULL, ncpu = 2)
A SpatRaster containing the water balance of the Alps.
wbRast
wbRast
A PackedSpatRaster with 12 monthly values of 12 variables:
temp
, prec
, PET
, P_PET
, PPA
,
ST
, i_ST
, RET
, HD
, HEX
, r
,
rP
.