Learn R Programming

UVdose (version 0.1.1)

daily_uvb: Daily UVB

Description

This function extracts total daily vitamin D-effective UVB dose on a given date and geographical location (longitude and latitude).

Usage

daily_uvb(
  data,
  date,
  longitude,
  latitude,
  temis_path = getwd(),
  region = "europe"
)

Value

A numeric vector of daily ambient UVB dose measurements.

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.

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("1000016"),
        date = as.Date(c("2010-08-04")),
        longitude = c(-2.10),
        latitude = c(50.5))
uvb_example <- system.file("extdata", "uvb_example", package="UVdose")
daily_uvb(mysample, date, longitude, latitude, temis_path = uvb_example)

Run the code above in your browser using DataLab