# plotting tst.variables
# Helper functions for estimating parameters of equations to be used in a tst.model
# This is simply a wrapper xts
source("~/GitHub/TST themes/Chart themes.R")
tst.plot <- function(variable, date = NA, data = m){
x <- m %>%
dplyr::select(Date, paste0(variable))
x <- x[complete.cases(x),]
x <- x %>%
gather(Var, Val, -Date)
p <- ggplot(x)+
geom_line(aes(x = Date, y = Val, colour = Var))+
tst_theme()+
scale_colour_tst()+
theme(legend.title = element_blank())
return(p)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.