【问题标题】:How to include parentheses in R markdown when writing ggplot axis titles?编写ggplot轴标题时如何在R markdown中包含括号?
【发布时间】:2018-03-18 18:12:55
【问题描述】:

这只是一个简单的语法问题,但我无法弄清楚。我有一个非常简单的情节要制作,在我的 CSV 文件中有一个标题为:收入(百万)的列。当我写代码块时:

{r} ggplot(tweets, aes(x=TweetRate, y=Revenue (millions) )) +geom_point()

它显示错误并说找不到功能“收入”。为什么不读取括号内的部分?我尝试了各种方法,例如 Revenue_(millions)、Revenue (millions),但它总是停在第一个括号处。谢谢。

【问题讨论】:

  • 也许y = `Revenue (millions)`
  • Revenue (millions) 有效!谢谢!

标签: r ggplot2


【解决方案1】:

图书馆(读者) 图书馆(ggplot2) 测试

ggplot(test, aes(x=TweetRate, y="Revenue (millions)" )) + geom_point()

【讨论】:

    猜你喜欢
    • 2021-07-31
    • 1970-01-01
    • 1970-01-01
    • 2021-08-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多