Learn R Programming

FlowScreen (version 2.0)

set.plot.titles: Set plot titles

Description

Sets the title to be used for all plots.

Usage

set.plot.titles(
  TS,
  title.elements = c("StationID", "StnName", "Country"),
  delimeter = " - ",
  custom.title = NULL,
  title.size = 1
)

Value

Returns the input TS data.frame with a 'plot title' attribute added. This attribute will be the default option used for all plot titles unless an alternative title is passed to the plotting function, e.g. with regime.

Arguments

TS

data.frame of streamflow time series loaded with read.flows.

title.elements

A character vector with the title elements you want to include in the plot title, in the desired order. Possible values are: Agency, StationID, StnName, StateProv, Country, Lat, Lon, CatchmentArea_km2, MetadataSource. Default is c("StationID", "StnName", "Country"). Additional examples: c("StnName", "StateProv"), c("StnName", "StationID"), etc.

delimeter

separator for title elements, default is " - "

custom.title

String of a custom plot title. Default is NULL. Will supersede title.format if not NULL.

title.size

parameter cex for the base::plot function. Number indicating the amount by which plotting text and symbols should be scaled relative to the default. 1=default, 1.5 is 50 percent larger, 0.5 is 50 percent smaller, etc.

Author

Jennifer Dierauer

Examples

Run this code

# Load example ROBIN streamflow data
robin_path <- system.file("extdata", "ROBIN_example.csv", package = "FlowScreen")
TS <- read.flows(robin_path)
TS <- set.plot.titles(TS, title.elements = c("StationID", "StnName"))
regime(TS, title = TRUE)

TS <- set.plot.titles(TS, custom.title = "My Custom Plot Title")
regime(TS, title = TRUE)

Run the code above in your browser using DataLab