由于升级到R 2.15,格式化程序的参数似乎在抛出错误.这是一个争论,我每天都在使用2年,所以是一个巨大的冲击.
R版本2.15.0(2012-03-30)
ggplot2版本0.9.0
- > library(ggplot2)
- > x <- 1:100
- > y <- 1/x
- > p <- qplot(x,y)
- > p + scale_y_continuous(formatter = "percent")
- Error in continuous_scale(c("y","ymin","ymax","yend","yintercept",:
- unused argument(s) (formatter = "percent")
解决方法
语法已经变化了0.9.0版本.见过渡指南:
https://cloud.github.com/downloads/hadley/ggplot2/guide-col.pdf
- library(ggplot2)
- library(scales)
- x <- 1:100
- y <- 1/x
- p <- qplot(x,y) + scale_y_continuous(labels = percent)