Create a bar plot of PAH concentrations. The function allows you to group the data by one or more variables, and decide which grouping variables will determine order or color.
1 2 3 4 |
pah_dat |
dataframe with PAH concentrations. It is recommended that entire samples with censored observations (e.g., below detection limit) are removed from this data frame prior to calculating the difference between source and samples. This function assumes these samples have already been removed. |
conc_column |
column that contains PAH concentrations |
sample_id_column |
column name that contains unique sample id |
compound_column |
column name that contains PAH compound names. This can also include other chemicals, or sums of chemicals. |
compound_plot |
a vector of strings identifying which compounds from compound_column to include in the plot. If more than one compound is given, the plot will be faceted by compound. |
color_column |
a column with group variable by which to color code bars |
group_column |
a column by which to group and order the bars. |
order_column |
a column by which to order bars within groups. If left NA, this will default to the conc_column so bars are ordered low to high within groups or across all bars if no groups are given. |
conc_units |
character string, units for PAH concentration that will be used in labels on plots |
thresholds |
logical, whether to include the EPA 16 priority compound thresholds via a horizontal line. This is only appriopriate if the values being plotted are the EPA priority sum concentration. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.