Description Usage Arguments Value Examples
plot_county_locations
returns one or multiple plots with county
locations in California given either a vector of county names or codes,
or a PUR data frame with a county_cd
, county_name
,
pur_code
, or fips_code
column (A data frame returned from either
pull_pur_file
, pull_raw_pur
, or pull_clean_pur
).
1 2 3 4 5 6 7 | plot_county_locations(
counties_or_df,
separate_plots = FALSE,
fill_color = "red",
alpha = 0.5,
...
)
|
counties_or_df |
A character vector of county names, pur codes, or fips
codes. You can use the |
separate_plots |
TRUE / FALSE. If you provided multiple counties, whether you would like county outlines plotted in the same plot (FALSE), or if you would like separate plots returned in a list (TRUE). The default is FALSE. |
fill_color |
A character string giving either a ggplot2 color or a hex color code ("#0000FF", for example). The default is "red". |
alpha |
A number in [0,1] specifying the transparency of the fill color. Numbers closer to 0 will result in more transparency. The default is 0.5. |
... |
Used internally. |
A ggplot or a list of ggplots of Califnornia with shaded-in counties. List element names correspond to county names.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | fresno_spdf <- readRDS(system.file("extdata", "fresno_spdf.rds",
package = "purexposure"))
plot_county_locations("fresno", spdf = fresno_spdf)
plot_county_locations("fresno")
pur_df <- pull_clean_pur(1990, counties = c("01", "05", "12"))
plot_county_locations(pur_df)
plot_list <- plot_county_locations(c("san bernardino", "ventura"),
separate_plots = TRUE)
names(plot_list)
plot_list[[1]]
plot_list[[2]]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.