if (!("ggplot2" %in% installed.packages())) {
install.packages('ggplot2')
}
library('ggplot2')
if (!("devtools" %in% installed.packages())) {
install.packages('devtools')
}
if (!("tidyr" %in% installed.packages())) {
install.packages('tidyr')
}
library(tidyr)
if (!("dplyr" %in% installed.packages())) {
install.packages('dplyr')
}
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
#devtools::install_github('neuhausi/canvasXpress')
#devtools::install_local("~/git/canvas/R/canvasXpress.tar.gz")
#devtools::install_local("~/git/canvas/R/canvasXpress.tar.gz", build_manual = TRUE, upgrade = "always")
library('canvasXpress')
geom_line() is suitable for time series – by color
eco <- economics_long
colnames(eco)[2] <- "vari"
g <- ggplot(eco, aes(date, value01, colour = vari)) + geom_line()
g

canvasXpress(g)
geom_step() is useful when you want to highlight exactly when the y
value changes
recent <- economics[economics$date > as.Date("2013-01-01"), ]
g <- ggplot(recent, aes(date, unemploy)) + geom_line()
g
