Why do these give different behaviour? If I use the loop I only see the last line but if I unroll the loop I see both.
p <- ggplot(shortdf, aes(datetime))
p <- p + geom_line(aes(y = as.numeric(as.character(shortdf[[1]]))))
p <- p + geom_line(aes(y = as.numeric(as.character(shortdf[[2]]))))
p <- ggplot(shortdf, aes(datetime))
for (i in 1:2) {
p <- p + geom_line(aes(y = as.numeric(as.character(shortdf[[i]]))))
}