Produce line plot of a given univariate time series.
tslineplot(
x,
t = NULL,
pred = NULL,
pred.t = NULL,
cil = NULL,
ciu = NULL,
ci.t = NULL,
trend = c("none", "linear", "smooth"),
title = NULL,
x.name = NULL,
pred.name = "Predicted",
x.lwidth = 0.7,
pred.lwidth = 0.7,
x.col = "darkgrey",
pred.col = "steelblue4",
ci.col = "royalblue",
t.name = "Date/Time",
t.text.angle = 90,
t.numbreak = 10,
ylim = NULL
)A line plot of x will be displayed with no further values or objects returned.
a univariate time series object or a numeric vector or matrix.
a vector or list of time periods in which the series values were observed. The length of t must be identical to the length of x.
a vector of predicted or forecasted values of a univariate time series. This parameter can be omitted. Default is NULL.
a vector of time periods in which the predicted or forecasted values of a univariate time series are estimated. This parameter can be omitted. Default is NULL.
a vector of the prediction intervals' lower limits. Only necessary if pred and pred.t are provided. This parameter can be omitted. Default is NULL.
a vector of the prediction intervals' upper limits. Only necessary if pred and pred.t are provided. This parameter can be omitted. Default is NULL.
a vector of the time periods in which the prediction intervals are estimated.This parameter can be omitted. Default is NULL.
indicate whether a trend line should be included in the time series plot. Available options are `none`, `linear`, and `smooth`. If `linear`, a straight trend line estimated by linear regression model will be included. If `smooth`, the trend line will be estimated by LOESS regression model. Default is NULL, indicating that no trend line should be displayed.
title of the time series line plot.
name of the series. If omitted here, the series name found by tsname() will be taken over here. If tsname() is NULL, the variable name will be used instead. Default is NULL.
name of the series' predicted/forecasted values. Only necessary if pred and pred.t are provided. Default is `Predicted`.
line width of the series line plot. Default is 0.7.
line width of the line plot for the predicted/forecasted values. Default is 0.7.
line colour of the time series line plot. Default is `darkgrey`.
line colour of the line plot for the predicted/forecasted values. Default is `steelblue4`.
area colour of the prediction intervals. Default is `royalblue`.
name of the x-axis (time axis). Default is `Date/Time`.
angle of the tick labels on the x-axis (time axis). Default is 90 (vertical).
number of tick labels on the x-axis (time axis). Default is 10.
value limit of the y-axis. The values should be specified in c(lower_limit, upper_limit), where lower_limit and upper_limit are the values of the smallest and largest number of the y-axis, respectively. Default is NULL.
Ka Yui Karl Wu
If x is a ts object, parameter t can be omitted. You can convert a vector, a matrix or data frame column using tsconvert to a ts object.
tslineplot(airport$Travellers, trend = "linear")
Run the code above in your browser using DataLab