plot_locations_exposure: Plot exposure for multiple locations in a county.

Description Usage Arguments Value Examples

View source: R/05-plot.R

Description

plot_locations_exposure returns a plot of exposure to applied pesticides for multiple locations in a given county.

Usage

1
2
3
4
5
6
7
plot_locations_exposure(
  exposure_df,
  section_township = "section",
  fill = "viridis",
  alpha = 1,
  ...
)

Arguments

exposure_df

A data frame returned from write_exposure with 10 columns, including exposure, location, radius, longitude, and latitude. This data frame should be filtered so that there is one exposure value per location. (This could also be the 'exposure' element returned from 'calculate_exposure'.)

section_township

Either "section" (the default) or "township". Specifies which PLS unit to plot the county by.

fill

A palette from the colormap package. The default is "viridis". To see colormap palette options, visit https://bhaskarvk.github.io/colormap/ or run colormap::colormaps.

alpha

A number in [0,1] specifying the transparency of fill colors. Numbers closer to 0 will result in more transparency. The default is 1.

...

Used internally.

Value

A plot with one point per location, colored by each location's corresponding exposure value.

Examples

1
2
3
4
5
6
7
8
fresno <- purexposure::fresno_clean
df <- data.frame(location = c("295 West Saginaw Ave., Caruthers, CA 93609",
                              "55190 Point Rd., Big Creek, CA 93605"),
                 start_date = "2000-01-01", end_date = "2000-12-31")
temp_dir <- tempdir()
write_exposure(fresno, df, 3000, temp_dir)
exp_df <- readRDS(paste0(temp_dir, "/exposure_df.rds"))
plot_locations_exposure(exp_df)

leighseverson/purexposure documentation built on Aug. 13, 2021, 6:34 p.m.