View source: R/plotLakeProfile.r
profilePlot | R Documentation |
Plots an individual lake profile provided in long data format. If provided, dashed lines representing water quality criteria are also plotted. Default arguments are set to take data from the water quality portal, however, they may be updated as needed to reflect different data sources.
profilePlot(
data,
parameter = "CharacteristicName",
units = "ResultMeasure.MeasureUnitCode",
depth = "Depth, data-logger (ported)",
do = "Dissolved oxygen (DO)",
temp = "Temperature, water",
pH = "pH",
value_var = "ResultMeasureValue",
line_no = "DataLoggerLine",
do_crit,
temp_crit,
pH_crit
)
data |
Lake profile data (long format) |
parameter |
Column name containing parameter names. |
units |
Column name containing data units. |
depth |
Name of depth variable in input data. |
do |
Name of dissolved oxygen variable in input data. |
temp |
Name of temperature variable in input data. |
pH |
Name of pH variable in input data. |
value_var |
Column name of value variable. |
line_no |
Column name containing line number. |
do_crit |
Optional. Dissolved oxygen criterion to display on plot. |
temp_crit |
Optional. Temperature criterion to display on plot. |
pH_crit |
Optional. Vector of two pH criteria to display on plot. |
# Read in some profile data
nr=readWQP(type="narrowresult", siteid="UTAHDWQ_WQX-4938550", print=F)
act=readWQP(type="activity", siteid="UTAHDWQ_WQX-4938550", print=F)
nr_act=merge(nr, act, all.x=T)
profiles=nr_act[!is.na(nr_act$DataLoggerLine),] #Subset to profile data
table(droplevels(profiles$ActivityIdentifier)) #Find activity IDs associated w/ profiles
profilePlot(subset(profiles,ActivityIdentifier=="UTAHDWQ_WQX-BORFG051909-4938550-0519-Pr-F"))
profilePlot(subset(profiles,ActivityIdentifier=="UTAHDWQ_WQX-LC082807-210255-PR3855083007"), do_crit=4, temp_crit=20, pH_crit=c(6.5,9))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.