You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: R/plotFun.heat.R
+59-45Lines changed: 59 additions & 45 deletions
Original file line number
Diff line number
Diff line change
@@ -1,26 +1,27 @@
1
1
#' Plot heat index as a function of the input variables.
2
2
#'
3
-
#' The index is calculated with the R package \code{HeatStress}.
3
+
#' The index is calculated with the R package \code{HeatStress} or provided by the user.
4
4
#'
5
-
#' @param hu vector with relative humidity data. \code{hu} or \code{td} are mandatory.
6
-
#' @param td vector with dew point temperature data.\code{hu} or \code{td} are mandatory.
7
-
#' @param ta vector with air temperature data.
8
-
#' @param heat.index heat index to plot as a function of dew point/relative humidity and air temperature. Available (based on 2 variables): swbgt, hi, wbt.Stull, wbgt.Bernard, apparentTemp, effectiveTemp, humidex, discomInd.
5
+
#' @param hu vector with data for the variable to be plotted in the X-axis or relative humidity data. \code{hu} or \code{td} are mandatory.
6
+
#' @param td vector with data for the variable to be plotted in the X-axis or dew point temperature data.\code{hu} or \code{td} are mandatory.
7
+
#' @param ta vector with with data for the variable to be plotted in the Y-axis or temperature data.
8
+
#' @param heat.index vector with data to plot with colour markers or character with the heat index to plot as a function of the two input variables. Available (based on 2 variables): swbgt, hi, wbt.Stull, wbgt.Bernard, apparentTemp, effectiveTemp, humidex, discomInd.
9
9
#' @param xlim 2-element vector with X-axis limits for the density plot. Default: range of hu/td.
10
10
#' @param ylim 2-element vector with Y-axis limits for the density plot. Default: range of ta.
11
11
#' @param breaks.index vector of breaks for the heat index values. By default, breaks is adjusted to the minimum and maximum values of the index.
12
-
#' @param n.bins number of bins for kernel density calculation. Default= 500
13
-
#' @param add.contours logical. Add (default) or not contours for heat index values.
14
-
#' @param add.points logical. Add (default) or not points with the actual time series.
12
+
#' @param n.bins number of bins for kernel density calculation, only when 'heat.index' is a character. Default= 500
13
+
#' @param add.contours logical. Add (default) or not contours for heat index values. It is only valid when 'heat.index' is a character.
14
+
#' @param add.points logical. Add (default) or not points with the actual time series. It is only valid when 'heat.index' is a character
15
15
#' @param xlab X-axis label.
16
16
#' @param ylab Y-axis label.
17
17
#' @param title title above the plot.
18
18
#' @param unit.text character string to be placed in the colorbar with the units.
19
19
#' @param cex.main Relative size of the plot title. Default:1.5.
20
20
#' @param cex.unit numeric value giving the expansion factor of the units text. Default:1.
21
21
#' @param cex.textcbar numeric value giving the expansion factor of the colorbar text. Default:1.3.
22
-
#' @return Plot with the heat index values as a function of the input variables.
23
-
#' @details The two input variables of the desired index need to be provided, tas and either td or hu. Needed packages: HeatStress, RColorBrewer.
22
+
#' @return Scatter (if 'heat.index' is a vector) or image (if 'heat.index' is a character) plot with the heat index values as a function of the input variables.
23
+
#' @details When 'heat.index' is a character, the index is calculated and the two input variables of the desired index need to be provided, tas and either td or hu. Needed packages: HeatStress, RColorBrewer.
24
+
#' When 'heat.index' is a vector, the variable to be plotted in the X-axis should be included in 'hu' or 'td' and the plotted in the Y-axis in 'ta'.
This package was used in the following publications:
33
-
* Casanueva et al. 2019. Climate projections of a multi-variate heat stress index: the role of downscaling and bias correction, *Geoscientific Model Development*, https://www.geosci-model-dev-discuss.net/gmd-2018-294/
33
+
* Casanueva et al. 2019. Climate projections of a multi-variate heat stress index: the role of downscaling and bias correction, *Geoscientific Model Development*, https://www.geosci-model-dev.net/12/3419/2019/
34
34
* Casanueva et al. 2019. Escalating environmental heat exposure – a future threat for the European workforce, *Regional Environmental Change*.
0 commit comments