exposure_estimate_krige {EnvExpInd}R Documentation

Assess the environmental exposure using the kringe method

Description

Based on the kringe method, the pollutant exposure in each individual location was estimated and then assess the total pollutant exposure through the estimate_interval

Usage

exposure_estimate_krige(
  individual_data,
  individual_id,
  exposure_date,
  individual_lat,
  individual_lon,
  pollutant_data,
  pollutant_date = "date",
  pollutant_site_lat,
  pollutant_site_lon,
  pollutant_name = c("pm10", "so2"),
  estimate_interval = c(0:30),
  krige_model,
  nmax = 7,
  krige_method = "med"
)

Arguments

individual_data

data.frame, contains the refrence id, individual_id and exposure_date

individual_id

character, varibale name in individual_data, represents the unique id for each individual

exposure_date

character, varibale name in individual_data, which represents the start date to estimate the environment exposure

individual_lat

character, varibale name in individual_data, represents the latitude information of each idividual

individual_lon

character, varibale name in individual_data, represents the longtitude information of each idividual

pollutant_data

data.frame, contains the pollutant and site informatin. One column represents the site information and other columns represent the concentration of pollutants

pollutant_date

character,varibale name represents the date infromation for the air pollutant dataset

pollutant_site_lat

character, varibale name in pollutant_data, includes the latitude information of each monitoring site

pollutant_site_lon

character, varibale name in pollutant_data, includes the longtitude information of each monitoring site

pollutant_name

vector, pollutant name in the pollutant_data need to be estimated

estimate_interval

continue numeric vector, the estimation period, for example: 0:30, for each individual we estimate the environment exposure ranging from the exposure_date to exposure_date + 30 days

krige_model

?krige

nmax

?krige

krige_method

?krige

Value

A list. For each element in the list, there is a dataframe with the first column representing the individual id, the remaining columns represent the exposure estimation in different time points.

Author(s)

Bing Zhang, https://github.com/Spatial-R/EnvExpInd

Examples

## Not run: 
library(EnvExpInd)
library(maptools)
library(gstat)
individual_data$date <- as.Date(individual_data$date)
pollutant_data$date <- as.Date(pollutant_data$date)
pollutant_data_full <- timeseries_imput(data= pollutant_data,date_var = "date",
site_var = "site.name",imput_col = 3:8)
pollutant_data_tem <- merge(pollutant_data_full,site_data,by.x = "site.name",by.y = "site")
test.pollutant <- pollutant_data_tem[pollutant_data_tem$date == "2014-09-20",]
coordinates(test.pollutant) = ~lat + lon
########## please define the variogram in a right way  ####################
m <- fit.variogram(variogram(PM10~1, test.pollutant), vgm(1, "Sph", 200, 1))
exposure_estimate_krige(
       individual_data = individual_data,
       individual_id = "id",
       exposure_date ="date",
       individual_lat ="lat",
       individual_lon ="lon",
       pollutant_data = pollutant_data_tem,
       pollutant_date = "date",
       pollutant_site_lat = "lat",
       pollutant_site_lon = "lon",
       pollutant_name = c("PM10","PM2.5"),
       krige_model = m,
       nmax = 7,
       krige_method = "med",
       estimate_interval = c(0:10))
 
## End(Not run)

[Package EnvExpInd version 0.1.0 Index]