Df <- data.frame(x = c(3, 1, 5), y = c(2, 4, 6), label = c('a', 'b', 'c'))
p <- ggplot(Df, aes(x, y, label = label)) + xlab(NULL) + ylab(NULL)
p + geom_line() + opts(title = "geom_line")
这里,我用opts(title = "geom_line")对图像添加一个标题,但是却运行错误,提示我
> p + geom_line() + opts(title = "geom_line")
Error: Use 'theme' instead. (Defunct; last used in version 0.9.1)