timePlot | R Documentation |
Creates a plot of time-series data.
timePlot(x, y, Plot = list(), yaxis.log = FALSE, yaxis.rev = FALSE, yaxis.range = c(NA, NA), xaxis.range = range(x, na.rm = TRUE), ylabels = 7, xlabels = "Auto", xtitle = "", ytitle = "", caption = "", margin = c(NA, NA, NA, NA), ...) ## S4 method for signature 'Date,numeric' timePlot(x, y, Plot = list(name = "", what = "lines", type = "solid", width = "standard", symbol = "circle", filled = TRUE, size = 0.09, color = "black"), yaxis.log = FALSE, yaxis.rev = FALSE, yaxis.range = c(NA, NA), xaxis.range = range(x, na.rm = TRUE), ylabels = 7, xlabels = "Auto", xtitle = "", ytitle = deparse(substitute(y)), caption = "", margin = c(NA, NA, NA, NA), ...) ## S4 method for signature 'POSIXt,numeric' timePlot(x, y, Plot = list(name = "", what = "lines", type = "solid", width = "standard", symbol = "circle", filled = TRUE, size = 0.09, color = "black"), yaxis.log = FALSE, yaxis.rev = FALSE, yaxis.range = c(NA, NA), xaxis.range = range(x, na.rm = TRUE), ylabels = 7, xlabels = "Auto", xtitle = "", ytitle = deparse(substitute(y)), caption = "", margin = c(NA, NA, NA, NA), ...) ## S4 method for signature 'numeric,numeric' timePlot(x, y, Plot = list(name = "", what = "lines", type = "solid", width = "standard", symbol = "circle", filled = TRUE, size = 0.09, color = "black"), yaxis.log = FALSE, yaxis.rev = FALSE, yaxis.range = c(NA, NA), xaxis.range = range(x, na.rm = TRUE), ylabels = 7, xlabels = "Auto", xtitle = "", ytitle = deparse(substitute(y)), caption = "", margin = c(NA, NA, NA, NA), ...) ## S4 method for signature 'integer,numeric' timePlot(x, y, Plot = list(name = "", what = "points", type = "solid", width = "standard", symbol = "circle", filled = TRUE, size = 0.09, color = "black"), yaxis.log = FALSE, yaxis.rev = FALSE, yaxis.range = c(NA, NA), xaxis.range = range(x, na.rm = TRUE) + c(-1, 1), ylabels = 7, xlabels = "Auto", xtitle = "", ytitle = deparse(substitute(y)), caption = "", margin = c(NA, NA, NA, NA), xlabels.rotate = FALSE, ...) ## S4 method for signature 'difftime,numeric' timePlot(x, y, Plot = list(name = "", what = "lines", type = "solid", width = "standard", symbol = "circle", filled = TRUE, size = 0.09, color = "black"), yaxis.log = FALSE, yaxis.rev = FALSE, yaxis.range = c(NA, NA), xaxis.range = range(x, na.rm = TRUE), ylabels = 7, xlabels = "Auto", xtitle = "Auto", ytitle = deparse(substitute(y)), caption = "", margin = c(NA, NA, NA, NA), ...)
x |
the time/date data. |
y |
the y-axis data. |
Plot |
parameters defining the characteristics of the plot. See
|
yaxis.log |
logical, if |
yaxis.rev |
logical, if |
yaxis.range |
set the range of the y-axis. See Details. |
xaxis.range |
set the range of the x-axis. Set at January 1 through
December 31 for |
ylabels |
set up y-axis labels. See |
xlabels |
set up x-axis labels. See Details for details for valid values. |
xtitle |
the x-axis title (also called x-axis caption). Generally should be blank as titles are typically set up by the axis labeling routines. |
ytitle |
the y-axis title (also called y-axis caption). |
caption |
the figure caption. |
margin |
set the plot area margins, in units of lines of text. Generally
all NA or the output from |
... |
arguments for specific methods. |
xlabels.rotate |
logical, if |
For the timePlot
methods where the time/date data are of class "Date,"
"POSIXt," or "numeric," the values for xlabels
must be one of
"hours," "days," "months," "years," "water years," or "Auto," which will
select an appropriate axis labeling scheme based on the time span of the data.
May also be a list of valid arguments to datePretty
for finer control.
For the timePlot
method where the time/date data are of class "integer,"
the value for xlabels
must be one of "Auto," a number indicating the approximate
number of labels, or a list of valid arguments to linearPretty
for finer control.
For the timePlot
method where the time/date data are of class "difftime,"
the value for xlabels
must be one of "Auto" or a number indicating the approximate
number of labels.
For linear axes, the range can be set to virtually any pair of values. For log axes, the choice of range is more resticted—for less than one log-cycle, powers of whole numbers can be used; from 1 to about 3 log cycles, the choces should be powers of 3 or 10; and for more than 3 log cycles, the range sould be expressed only in powers of 10.
Information about the graph.
Create a time-series plot for Date and numeric data.
Create a time-series plot for POSIXt and #' numeric data.
Create a time-series plot for dates in decimal format and numeric data.
Create a time-series plot for annual summaries of numeric data.
Create a time-series plot for difftime and numeric data.
The function timePlot
produces a time-series plot. The function
seasonPlot
produces a plot of the annual cycle. There is no function
in the smwrGraphs package that will automatically transform time/date data
to the correct seasonal value; use dectime(x) - trunc(dectime(x))
,
where x
is the time/date variable.
setPage
, xyPlot
, seasonPlot
## Not run: # the months function is in lubridate X <- as.Date("2001-01-15") + months(0:11) set.seed(1) Y <- runif(12) setGD() timePlot(X, Y) # For more details of timePlot see vignette(topic="DateAxisFormats", package="smwrGraphs") vignette(topic="LineScatter", package="smwrGraphs") demo(topic="AnnualFlowBarChart", package="smwrGraphs") demo(topic="DurationHydrograph", package="smwrGraphs") demo(topic="HydroPrecip", package="smwrGraphs") demo(topic="RightAxisExample", package="smwrGraphs") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.