Package 'kehra'

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-09-13 05:55:48 UTC
Source: https://github.com/kehraproject/kehra

Help Index


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.

Details

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
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

Author(s)

Claudia Vitolo [aut, cre], Allan Tucker [aut], Andrew Russell [aut] Maintainer: Claudia Vitolo <[email protected]>


Fill missing values

Description

Fill missing values

Usage

fillMissingValues(ids, df, maxgap = 12, parallel = FALSE,
  formatDT = "%Y-%m-%d %H:%M")

Arguments

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

Value

updated df with infilled values

Examples

# fillMissingValues(clima)

Get season a date belongs to

Description

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.

Usage

getSeason(DATES)

Arguments

DATES

a date.

Value

returns the name of the season (e.g. "Fall")

Examples

# my.dates <- as.Date("2011-12-01", format = "%Y-%m-%d") + 0:60
# getSeason(my.dates)

Get data from ECMWF ERA_Interim

Description

Get data from ECMWF ERA_Interim

Usage

pointInspection(years, points, var, prefix = "", path = "~",
  parallel = FALSE)

Arguments

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

Details

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).

Value

time series variable

Examples

# pointInspection(years = 1981:2014, points, var = "t2m")

Wind Direction

Description

Calculate wind direction in degrees from u & v components

Usage

windDirection(u, v)

Arguments

u

first component of wind speed

v

second component of wind speed

Value

direction in degrees from u & v components

Examples

# windDirection(u, v)

Wind Speed

Description

Calculate wind speed in m/s from u & v components

Usage

windSpeed(u, v)

Arguments

u

first component of wind speed

v

second component of wind speed

Value

Speed in m/s

Examples

# windSpeed(u, v)