Learn R Programming

daltoolbox (version 1.1.727)

plot_series: Plot series

Description

This function creates a time series plot using ggplot2.

Usage

plot_series(data, label_x = "", label_y = "", colors = NULL)

Value

returns a ggplot graphic

Arguments

data

data.frame contain x, value, and variable

label_x

x-axis label

label_y

y-axis label

colors

color vector

Examples

Run this code
x <- seq(0, 10, 0.25)
data <- data.frame(x, sin=sin(x))
head(data)

grf <- plot_series(data, colors=c("red"))
plot(grf)

Run the code above in your browser using DataLab