Learn R Programming

RMOPI (version 1.1)

gglineplot: Plot the Time Series

Description

Plot the time series data beautifully with ggplot.

Usage

gglineplot(data, mapping, date_labels = "%Y/%m/%d", date_breaks = "2 weeks")

Value

A ggplot figure of the time series

Arguments

data

a tibble

mapping

the mapping parameter

date_labels

the x label

date_breaks

the period of the x label

Examples

Run this code
date <- as.Date("2015-01-01") + days(0:180)
thero <- returns(rGbm("thero", date))[-1]
tthero <- tibble(x = date[-1], y = thero)
gglineplot(tthero, aes(x, y), "%Y/%m", "1 months")

Run the code above in your browser using DataLab