powered by
Simple time series plot with points and a line.
plot_ts(x = NULL, y, label_x = "", label_y = "", color = "black")
returns a ggplot2::ggplot graphic
time index (numeric vector) or NULL to use 1:length(y)
numeric series
x‑axis label
y‑axis label
color for the series
If x is NULL, an integer index 1:n is used. The color applies to both points and line.
x
x <- seq(0, 10, 0.25) y <- sin(x) grf <- plot_ts(x = x, y = y, color=c("red")) plot(grf)
Run the code above in your browser using DataLab