plot-cfRain-missing-method: Plot Rain Time series

Description Usage Arguments Details See Also Examples

Description

Plot the amount of rainfall (mm) through time, with optional available soil water capacity and runoff amounts (if applicable).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## S4 method for signature 'cfRain,missing'
plot(
  x,
  y,
  include_runoff = TRUE,
  ggtheme = c("grey", "gray", "bw", "linedraw", "light", "minimal", "classic"),
  scales = c("fixed", "free_x", "free_y", "free"),
  n_col = 1,
  ...
)

Arguments

x

a cfRain object.

y

missing.

include_runoff

a logical indicating whether to plot the soil moisture deficit and runoff as well as the rainfall, if the data is available (default TRUE).

ggtheme

character string (partially) matching the ggtheme to be used for plotting, see 'Theme Selection' below.

scales

character string partially matching the scales argument in the link[ggplot2]{facet_wrap} function.

n_col

the number of columns of plots (default 1).

...

further arguments passed to theme.

Details

When there is a rain event, the amount of runoff, if any, is dependent on how much capacity the soil has available for more water. If there is no available water capacity left in the soil then more rain will lead to a runoff event. If include_runoff = TRUE, the available water capacity is plotted as negative values and the runoff as positive values to signify this negative relationship.

See Also

plot,cfDataList,missing-method for general information on default plotting of cfData and cfDataList objects, and the links within. See cf_query for creating cfRain objects.

Refer to theme for more possible arguments to pass to these methods.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 
# Retrieve public rain data for a month from CliFlo (at Reefton Ews station)
reefton_rain = cf_query(cf_user(), cf_datatype(3, 1, 1), cf_station(),
                        start_date = "2012-08-01-00",
                        end_date = "2012-09-01-00")

class(reefton_rain) # cfRain object

# Plot the rain data using the defaults
plot(reefton_rain)

# Change the ggtheme and enlarge the text
library(ggplot2) # for element_text()
plot(reefton_rain, ggtheme = "bw", text = element_text(size = 16))

# Save the plot as a png to the current working directory
library(ggplot2) # for ggsave()
ggsave("my_rain_plot.png")

## End(Not run)

clifro documentation built on May 24, 2021, 9:06 a.m.