Learn R Programming

daltoolbox (version 1.2.727)

plot_ts: Plot time series chart

Description

This function plots a time series chart with points and a line using ggplot2.

Usage

plot_ts(x = NULL, y, label_x = "", label_y = "", color = "black")

Value

returns a ggplot2::ggplot graphic

Arguments

x

input variable

y

output variable

label_x

x-axis label

label_y

y-axis label

color

color for time series

Examples

Run this code
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