Visualizing ts objects Using ggplot
devtools::install_github("tonyy01/ggts")
First, import ggts and use the ggts function inside it.
library(ggts)
Suppose we want to visualize the ts object co2.
Here is the base R package "graphics"' visulization:
plot(co2)
Here is the ggplot's visulization:
ggts(co2)
Since the plot is a ggplot object, you are able to utilize all of the ggplot grammar on the object. For instance, you can change the labels for x axis and y axis to the graphics' like appearance:
ggts(co2) +
labs(x = "Time", y = "co2")