格式化参数在scale_continuous投掷的错误中的R 2.15(formatter argu

2019-06-23 14:33发布

由于升级至R 2.15,格式化说法似乎引发错误。 这是我一直在使用每天2年的说法,那么一个巨大的无赖。

ř版本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")

Answer 1:

语法已与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)


文章来源: formatter argument in scale_continuous throwing errors in R 2.15
标签: r ggplot2