View source: R/RMevents.plotQ.R
| RMevents.plotQ | R Documentation |
Function to graph rainfall and flow for a given x-day window around specified event periods
RMevents.plotQ( df, dfQ, date = "pdate", Qdate = "pdate", rain = "rain", Q = "Q", df.events, sdate = "StartDate", edate = "EndDate", erain = "depth", plot.buffer = 3, logy = "", site.name = "", SampleInfo, sampbdate = "", sampedate = "" )
df |
dataframe with unit value rainfall data |
dfQ |
dataframe with unit value Q data |
date |
string Date column in df as POSIXct |
Qdate |
string Date column in dfQ as POSIXct |
rain |
string Column in df with instantaneous rain values |
Q |
string Column in dfQ with instantaneous Q values |
df.events |
dataframe with start and end dates/times for events |
sdate |
string Start date column in df.events rain file as POSIXct |
edate |
string End date column in df.events as POSIXct |
erain |
string Event rainfall depth column in df.events |
plot.buffer |
numeric Used to define plotting window in days. Graphs will include |
logy |
string "y" if log y-axis for Q or "" if linear axis. Will default to "". |
site.name |
site name as data type character |
SampleInfo |
if TRUE then sample start and end dates/times are plotted on the hydrograph; if FALSE then sample start and end dates/times are not plotted on the hydrograph. |
sampbdate |
character column name in df.events for the beginning of the sampling period |
sampedate |
character column name in df.events for the ending of the sampling period |
plots of rainfall events and discharge
#Example 1 - Rainfall/Q plots without sample start/end arrows
RDB <- CedarRRain
dfQ <- cedarq
dfQ <- RMprep(dfQ,prep.type=1,date.type=3,tz="CST6CDT")
RDB2 <- RMprep(RDB,prep.type=1,date.type=1,dates.in="CST.Time",tz="CST6CDT")
RDB3 <- subset(RDB2,
upload.ph3_site_basin_cedar_creek.Id.0....Geographical.Mean.kg.m.2.>-1)
event.list <- RMevents(df=RDB3,ieHr=6,rainthresh=0.2,
rain="upload.ph3_site_basin_cedar_creek.Id.0....Geographical.Mean.kg.m.2.")
events.0.2 <- event.list$storms2
site.name <- "Example Site"
SampleInfo <- FALSE
RMevents.plotQ(RDB3,dfQ,
rain="upload.ph3_site_basin_cedar_creek.Id.0....Geographical.Mean.kg.m.2.",
df.events=events.0.2,erain="rain",
site.name=site.name,SampleInfo=SampleInfo)
#Example 2- Rainfall/Q plots with sample start/end arrows
RDB <- CedarRRain
cedarSamples <- cedarSamples
names(RDB)[2] <- "UVRain"
RDB2 <- RMprep(RDB,
prep.type=1,
date.type=1,
dates.in="CST.Time",
tz="CST6CDT")
eventListSamples <- RMevents_sample(df=RDB2,
ieHr=6,
rain="UVRain",
time="pdate",
dfsamples=cedarSamples,
bdate="pSstart",edate="pSend")
dfQ <- cedarq
dfQ <- RMprep(dfQ,prep.type=1,date.type=3,tz="CST6CDT")
site.name <- "Example Site"
SampleInfo <- TRUE
sampbdate <- "pSstart"
sampedate <- "pSend"
#RMevents.plotQ(RDB2,
# dfQ,
# rain="UVRain",
# df.events=eventListSamples,
# sdate="Braindate",
# edate="Eraindate",
# erain="depth",logy="",site.name=site.name,
# sampbdate="pSstart",sampedate="pSend")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.