Learn R Programming

UVdose (version 0.1.1)

season_uvb: Seasonal UVB

Description

This function estimates mean or cumulative vitamin D-effective UVB dose over a period of months (<1 year) prior to the index date, at a given geographical location (longitude and latitude).

Usage

season_uvb(
  data,
  date,
  longitude,
  latitude,
  temis_path = getwd(),
  season = "summer",
  type = "cumulative",
  region = "europe"
)

Value

A numeric vector of mean or cumulative seasonal UVB dose estimates.

Arguments

data

data frame containing sample IDs, date, longitude, and latitude

date

A date vector, usually date of assessment or recruitment.

longitude

A numeric vector of longitude values.

latitude

A numeric vector of latitude values.

temis_path

Path to TEMIS UV files downloaded using temis_uvdvc. Default is current directory.

season

The duration over which erythemal UV dose is to be estimated. One of "summer" covering April to September (default), "winter" covering October to March, or a numeric vector corresponding to month range.

type

Type of annual dose to be calculated, cumulative (default) or mean.

region

Region of TEMIS data required, options are "europe" (default) or "world".

Examples

Run this code
#uses sample TEMIS file
mysample <- data.frame(id = c("id000016"),
        date = as.Date(c("2010-08-04")),
        longitude = c(-2.10),
        latitude = c(50.5))
uvb_example <- system.file("extdata", "uvb_example", package="UVdose")
season_uvb(mysample, date, longitude, latitude, temis_path=uvb_example,  season = "winter")

season_uvb(mysample, date, longitude, latitude, temis_path=uvb_example, season = c(6:8))

Run the code above in your browser using DataLab