gpt4 book ai didi

r - scale_continuous 中的格式化程序参数在 R 2.15 中抛出错误

转载 作者:行者123 更新时间:2023-12-04 11:18:13 25 4
gpt4 key购买 nike

由于升级到 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://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)

关于r - scale_continuous 中的格式化程序参数在 R 2.15 中抛出错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10146109/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com