Learn R Programming

UVdose (version 0.1.1)

annual_uvb: Annual UVB

Description

This function extracts vitamin D-effective UVB dose (i.e. UVB wavelenghts that can induce vitamin D synthesis in human skin) on a particular date and geographical location (longitude and latitude), over one year prior to the index date.

Usage

annual_uvb(
  data,
  date,
  longitude,
  latitude,
  temis_path = getwd(),
  type = "cumulative",
  region = "europe"
)

Value

A numeric vector of mean or cumulative annual vitamin D UVB dose estimates.

Arguments

data

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

date

date vector, usually date of assessment or recruitment.

longitude

numeric vector of longitude values.

latitude

numeric vector of latitude values.

temis_path

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

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")
annual_uvb(mysample, date, longitude, latitude, temis_path=uvb_example)

Run the code above in your browser using DataLab