In [ ]:
library(ggplot2)
library(gcookbook)
library(plyr)

4.1 Basic line


In [ ]:
str(BOD)
BOD

In [ ]:
ggplot(data = BOD, aes(x = Time, y = demand)) +
geom_line()

In [ ]:
BOD1 <- BOD
BOD1$Time <- factor(BOD$Time)

In [ ]:
ggplot(data = BOD1, aes(x = Time, y = demand, group = 1)) +
geom_line()

In [ ]:
ggplot(data = BOD, aes(x = Time, y = demand)) +
geom_line() +
expand_limits(y=c(-5, 50))

In [ ]:
ggplot(data = BOD, aes(x = Time, y = demand)) +
geom_line() +
ylim(0, max(BOD$demand))