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 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 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 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 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 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), ...)
the time/date data.
the y-axis data.
parameters defining the characteristics of the plot. See
setPlot
for a description of the parameters.
logical, if TRUE
, then log-transform the y axis.
logical, if TRUE
, then reverse the y axis.
set the range of the y-axis. See Details.
set the range of the x-axis. Set at January 1 through
December 31 for seasonPlot
.
set up y-axis labels. See linearPretty
for
details.
set up x-axis labels. See Details for details for valid values.
the x-axis title (also called x-axis caption). Generally should be blank as titles are typically set up by the axis labeling routines.
the y-axis title (also called y-axis caption).
the figure caption.
set the plot area margins, in units of lines of text. Generally
all NA or the output from setGraph
if appropriate.
arguments for specific methods.
logical, if TRUE
, then rotate the x-axis labels
so that they are perpendicular to the x-axis.
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.
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.
Added from smwrGraphs.
# 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")
# }
Run the code above in your browser using DataLab