plotObs | R Documentation |
This function creates a ggplot2 object from an obs data frame. If the specified variables are all of single type (e.g. temperature), it returns a single-pane plot. If the specified variables are of more than one type (e.g. temperature, precipitation), then the plot is faceted. The function returns an object that you can modify, or save with the standard ggplot2 commands.
plotObs(obs, varcols = c(0), startDate = "", endDate = "", plotType = "lines")
obs |
Required. The CRHMr obs data frame to be plotted. |
varcols |
Optional. A vector containing the numbers of the columns (not including the datatime) to be plotted. If not specified, all variables are plotted. |
startDate |
Optional. The starting date for the plot. Can either be a year as a number (e.g. |
endDate |
Optional. The ending date for the plot. Can either be a year as a number (e.g. |
plotType |
Optional. Defines the type of the plot. Either lines or points. Default is lines. If you want to show the extent of data, use points as lines will NOT be drawn when points are separated by |
Units are automatically specified for obs variables of the following types: t
, rh
, u
, p
, ea
, and solar radiation.
If successful returns a ggplot2 object. If unsuccessful, returns the value FALSE
.
Note that missing (NA_real_
) values in the obs data frame will result in a warning message.
Kevin Shook
summariseObsFiles
p <- plotObs(BadLake7376)
print(p)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.