# \donttest{
# using the ggplot2 graphic system
p <- ts_ggplot(total = ldeaths, female = fdeaths, male = mdeaths)
p
# with themes for the look and feel of ts_plot()
p + theme_tsbox() + scale_color_tsbox()
# also use themes with standard ggplot
suppressMessages(library(ggplot2))
df <- ts_df(ts_c(total = ldeaths, female = fdeaths, male = mdeaths))
ggplot(df, aes(x = time, y = value)) +
facet_wrap("id") +
geom_line() +
theme_tsbox() +
scale_color_tsbox()
# }
if (FALSE) {
library(dataseries)
dta <- ds(c("GDP.PBRTT.A.R", "CCI.CCIIR"), "xts")
ts_ggplot(ts_scale(ts_span(
ts_c(
`GDP Growth` = ts_pc(dta[, 'GDP.PBRTT.A.R']),
`Consumer Sentiment Index` = dta[, 'CCI.CCIIR']
),
start = "1995-01-01"
))) +
ggplot2::ggtitle("GDP and Consumer Sentiment", subtitle = "normalized") +
theme_tsbox() +
scale_color_tsbox()
}
Run the code above in your browser using DataLab