-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
162 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
Package: HeatStress | ||
Type: Package | ||
Title: Calculate heat stress indices | ||
Version: 1.0.6 | ||
Date: 2019-03-11 | ||
Version: 1.0.7 | ||
Date: 2019-07-01 | ||
Author: A. Casanueva | ||
Maintainer: A.Casanueva <ana.casanueva@meteoswiss.ch> | ||
Description: Calculate heat stress indices based on meteorological data. | ||
License: file LICENCE | ||
RoxygenNote: 6.0.1 | ||
Depends: R (>= 2.10.0) | ||
License: file LICENSE | ||
RoxygenNote: 6.1.1 | ||
Depends: R (>= 2.10.0), magrittr | ||
Suggests: testthat, assertthat | ||
Imports: stats | ||
Encoding: ISO-8859-1 | ||
|
||
Encoding: UTF-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#' @title List all available heat indices | ||
#' @description Print a table with a summary of the available indices | ||
#' @return Print a table on the screen with the following columns: | ||
#' \itemize{ | ||
#' \item \strong{code}: Code of the index. | ||
#' \item \strong{longname}: Long description of the index | ||
#' \item \strong{index.fun}: The name of the internal function used to calculate it | ||
#' \item \strong{tas, dewp, hurs, wind, radiation}: A logical value (0/1) indicating the input variables required for index calculation. Temperature and either dew point temperature or relative humidity need to be always provided. | ||
#' \item \strong{units}: The units of the index. | ||
#' } | ||
#' @author A. Casanueva | ||
#' @export | ||
|
||
indexShow <- function() { | ||
read.master() | ||
} | ||
|
||
#' @keywords internal | ||
#' @importFrom magrittr %>% | ||
#' @importFrom utils read.table | ||
|
||
read.master <- function() { | ||
system.file("master", package = "HeatStress") %>% read.table(header = TRUE, | ||
sep = ";", | ||
stringsAsFactors = FALSE, | ||
na.strings = "") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#' @importFrom utils packageDescription | ||
|
||
.onAttach <- function(...) { | ||
pkgname <- "HeatStress" | ||
ver <- packageDescription(pkgname)$Version | ||
builddate <- packageDescription(pkgname)$Date | ||
mess <- paste(pkgname, " version ", ver, " (", builddate,") is loaded", sep = "") | ||
packageStartupMessage(mess) | ||
url <- paste0("https://raw.githubusercontent.com/anacv/", pkgname, "/master/DESCRIPTION") | ||
b <- tryCatch(suppressWarnings(readLines(url)), error = function(er) { | ||
er <- NULL | ||
return(er) | ||
}) | ||
if (!is.null(b)) { | ||
latest.ver <- package_version(gsub("Version: ", "", b[grep("^Version", b)])) | ||
if (ver < latest.ver) { | ||
ver.mess1 <- paste0("WARNING: Your current version of ", pkgname, " (v", ver, ") is not up-to-date") | ||
ver.mess <- paste0("Get the latest stable version (", latest.ver, | ||
") using <devtools::install_github('anacv/", pkgname, "')>") | ||
packageStartupMessage(ver.mess1) | ||
packageStartupMessage(ver.mess) | ||
} else if (ver > latest.ver) { | ||
ver.mess1 <- paste0("WARNING: Your current version of ", pkgname, " (v", ver, | ||
") is ahead of the master branch version (", latest.ver, ")") | ||
ver.mess <- paste0("Development version may have an unexpected behaviour") | ||
packageStartupMessage(ver.mess1) | ||
packageStartupMessage(ver.mess) | ||
} | ||
} | ||
packageStartupMessage("Use 'indexShow()' for an overview of the available heat indices") | ||
} | ||
# End |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,29 @@ | ||
# HeatStress | ||
Heat Stress indices for Heat-Shield | ||
|
||
## What is `HeatStress`? | ||
|
||
**HeatStress** is a R package for the calculation of heat stress indices. It has been developed in the framework of the Horizon2020 [HEAT-SHIELD project](www.heat-shield.eu). | ||
|
||
**** | ||
|
||
### Installation | ||
|
||
The recommended procedure for installing the package is using the devtools package. | ||
|
||
```R | ||
devtools::install_github("anacv/HeatStress") | ||
``` | ||
|
||
A list of all available indices and the atomic functions calculating them is printed on screen with: | ||
|
||
```R | ||
library(HeatStress) | ||
indexShow() | ||
``` | ||
|
||
### Reference and further information: | ||
|
||
This package was used in the development of climate change scenarios of heat stress, in the following publications: | ||
* 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/ | ||
* Casanueva et al. 2019. Escalating environmental heat exposure – a future threat for the European workforce, *Regional Environmental Change*. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
code;longname;indexfun;tas;dewp;hurs;wind;radiation;units | ||
wbt;Wet Bulb Temperature; wbt.Stull;1;0;1;0;0;degC | ||
wbgt_shade;Wet Bulb Globe Temperature (shade);wbgt.Bernard;1;1;0;0;0;degC | ||
wbgt_sun;Wet Bulb Globe Temperature (sun);wbgt.Liljegren;1;1;0;1;1;degC | ||
swbgt;simplified wet bulb globe temperature;swbgt;1;0;1;0;0;degC | ||
apparentTemp;apparent temperature;apparentTemp;1;0;1;1;0;degC | ||
effectiveTemp;effective temperature;effectiveTemp;1;0;1;1;0;degC | ||
humidex;humidex;humidex;1;0;1;0;0;degC | ||
discomInd;discomfort index;discomInd;1;0;1;0;0;degC | ||
hi;heat index;hi;1;0;1;0;0;degF | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.