Title: | Collect, Assemble and Model Air Pollution, Weather and Health Data |
---|---|
Description: | Collection of utility functions used in the KEHRA project (see http://www.brunel.ac.uk/ife/britishcouncil). It refers to the multidimensional analysis of air pollution, weather and health data. |
Authors: | Claudia Vitolo [aut, cre], Allan Tucker [aut], Andrew Russell [aut] |
Maintainer: | Claudia Vitolo <[email protected]> |
License: | GPL-3 |
Version: | 0.3 |
Built: | 2024-11-12 04:56:55 UTC |
Source: | https://github.com/kehraproject/kehra |
Collection of utility functions used in the KEHRA project (see http://www.brunel.ac.uk/ife/britishcouncil). It refers to the multidimensional analysis of air pollution, weather and health data.
The DESCRIPTION file:
Package: | kehra |
Type: | Package |
Title: | Collect, Assemble and Model Air Pollution, Weather and Health Data |
Version: | 0.3 |
Date: | 2016-06-09 |
Author: | Claudia Vitolo [aut, cre], Allan Tucker [aut], Andrew Russell [aut] |
Maintainer: | Claudia Vitolo <[email protected]> |
URL: | https://github.com/kehraProject/r_kehra |
BugReports: | https://github.com/kehraProject/r_kehra/issues |
Description: | Collection of utility functions used in the KEHRA project (see http://www.brunel.ac.uk/ife/britishcouncil). It refers to the multidimensional analysis of air pollution, weather and health data. |
Depends: | R (>= 2.14.0) |
Imports: | Hmisc, raster, reshape2, stringr, sp, xts, zoo |
License: | GPL-3 |
RoxygenNote: | 5.0.1 |
Suggests: | covr |
Config/pak/sysreqs: | libgdal-dev gdal-bin libgeos-dev make libicu-dev libproj-dev libsqlite3-dev |
Repository: | https://kehraproject.r-universe.dev |
RemoteUrl: | https://github.com/kehraproject/kehra |
RemoteRef: | HEAD |
RemoteSha: | 62dee303d1a524fd63ea8ab3c05a54f16c2b3fa1 |
Index of help topics:
fillMissingValues Fill missing values getSeason Get season a date belongs to kehra-package Collect, Assemble and Model Air Pollution, Weather and Health Data pointInspection Get data from ECMWF ERA_Interim windDirection Wind Direction windSpeed Wind Speed
Collection of utility functions used in the KEHRA project
Claudia Vitolo [aut, cre], Allan Tucker [aut], Andrew Russell [aut] Maintainer: Claudia Vitolo <[email protected]>
Fill missing values
fillMissingValues(ids, df, maxgap = 12, parallel = FALSE, formatDT = "%Y-%m-%d %H:%M")
fillMissingValues(ids, df, maxgap = 12, parallel = FALSE, formatDT = "%Y-%m-%d %H:%M")
ids |
site identification codes |
df |
dataframe containing the timeseries in columns separated by ID (header must follow this convention: column 1 = "datetime", column 2 = "SiteID", column 3 = "variable name"). df can be the result of GetDataFromECMWF(). |
maxgap |
maximum gap to interpolate (e.g. 6 hours) |
parallel |
Bolean, if TRUE parallel jobs are allowed |
formatDT |
format of the datetime variable |
updated df with infilled values
# fillMissingValues(clima)
# fillMissingValues(clima)
Get season a date belongs to. This function was taken from the following stackoverflow post: http://stackoverflow.com/questions/9500114/find-which-season-a-particular-date-belongs-to.
getSeason(DATES)
getSeason(DATES)
DATES |
a date. |
returns the name of the season (e.g. "Fall")
# my.dates <- as.Date("2011-12-01", format = "%Y-%m-%d") + 0:60 # getSeason(my.dates)
# my.dates <- as.Date("2011-12-01", format = "%Y-%m-%d") + 0:60 # getSeason(my.dates)
Get data from ECMWF ERA_Interim
pointInspection(years, points, var, prefix = "", path = "~", parallel = FALSE)
pointInspection(years, points, var, prefix = "", path = "~", parallel = FALSE)
years |
years to retrieve data for |
points |
are lat/lon coordinates of points (e.g. stations) |
var |
variable to retrieve |
prefix |
string starting netcdf file name |
path |
folder path where netcdf files are stored |
parallel |
Bolean, if TRUE parallel jobs are allowed |
Possible variables names are: "t2m" (2m temperature, in K), "u10" (10 metres wind U component, in m/s), "v10" (10 metres wind V component, in m/s), "tp" (total precipitation, in m), "blh" (boundary layer height, in m), "ssr" (surface net solar radiation, in W/m2s).
time series variable
# pointInspection(years = 1981:2014, points, var = "t2m")
# pointInspection(years = 1981:2014, points, var = "t2m")
Calculate wind direction in degrees from u & v components
windDirection(u, v)
windDirection(u, v)
u |
first component of wind speed |
v |
second component of wind speed |
direction in degrees from u & v components
# windDirection(u, v)
# windDirection(u, v)
Calculate wind speed in m/s from u & v components
windSpeed(u, v)
windSpeed(u, v)
u |
first component of wind speed |
v |
second component of wind speed |
Speed in m/s
# windSpeed(u, v)
# windSpeed(u, v)