Description Usage Arguments Value Examples
View source: R/stfl_plot_add_regional_fit.R
Add the regional fit to an existing trend plot
1 2 3 4 5 | stfl_plot_add_regional_fit(
plot,
regional.fit,
plot.fit = c("LMrob", "LM", "MK")[1]
)
|
plot |
An existing plotly objects to which the regional fit will be added |
regional.fit |
A list object containing the results of the region fit. See
the help page for |
plot.fit |
Which trend lines should be added to the plots. Possible values are one or more of
If you try and plot a method that was not computed, a warning message is printed and the request is ignored. |
Plotly object is returned with the regional fit(s) added to the plot.
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## Not run:
# needs the HYDAT package installed
station.id <- c("08NM053","08NM116")
data <- stfl_get_annual_stat(station.id, Statistic=c("MEAN"))
temp <- stfl_trend_kstn_kstat(data, log.Y=TRUE)
myplot <- stfl_plot_trends(temp, plot.fit=c("MK","LM","LMrob"))
myplot
data$REGION <- "AnyOldRegion"
mystation.weights <- data.frame(STATION_NUMBER=station.id, WEIGHT=c(2,1))
regional.fit <- stfl_trend_regional(data, mystation.weights, log.Y=TRUE)
stfl_plot_add_regional_fit(myplot, regional.fit[[1]])
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.