Description Usage Arguments Value Author(s) Examples
View source: R/exposure_estimate_idw.R
Used the pollutant concentration in the individual location as the reference point to estimate the environmental exposure. The pollutant concentration at the refrence point was calculated based on the inverse distance weighting method.
1 2 3 4 5 6 7 8 9 10 11 12 13 | exposure_estimate_idw(
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)
)
|
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, which represent the name of the target pollutants 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 |
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.
Bing Zhang, https://github.com/Spatial-R/EnvExpInd
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | library(EnvExpInd)
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")
exposure_estimate_idw(
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"),
estimate_interval = c(0:10))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.