【问题标题】:Turn off scientific notation visualcode (scipen not working in R profile?)关闭科学记数法可视化代码(scipen 在 R 配置文件中不起作用?)
【发布时间】:2022-01-21 01:14:09
【问题描述】:

我已经下载了 R 工作室,以及 Visualcode 中的 R 扩展。 在我输入的 R 配置文件中 options(scipen=999) 并保存。

当我在可视化代码中运行我的代码时,它不会在我的输出条形图中摆脱科学记数法。为什么?

谢谢你:)

【问题讨论】:

    标签: r output notation


    【解决方案1】:

    试试这个:

    scale_y_continous中将format函数的scientific参数设置为FALSE

    ggplot(mtcars, aes(cyl, mpg))+
      geom_col()+
      scale_y_continuous(labels = function(x) format(x, scientific = FALSE))
    

    【讨论】:

    • 谢谢,我会努力的。 :) 我认为我的问题可能是我没有在 R 中下载语言服务器。问题是当我使用 install.packages("languageserver") 时它似乎没有正确安装。它说那里有22个警告?你知道那有什么问题吗。我有 R 3.4.4,我认为语言服务器适合那个版本。
    • 在哪里可以找到 scale_y_continous? :)
    • ggplot2。如果您想更改 y 轴,只需添加到您的代码中,否则 scale_x_continous! :-) 看这里 ggplot2.tidyverse.org/reference/scale_continuous.html>
    • 看这里如何提出一个好问题!它提高了几乎 100% 获得好答案的变化 stackoverflow.com/help/minimal-reproducible-example>
    • 谢谢 :) 我想我明白一点知道。我真的很糟糕,对不起。努力学习。但是当我使用 install.packages("ggplot2", dependencies = TRUE) 安装 ggplot 包时,我收到 32 个警告。为什么我不能安装它是因为我也不能安装语言服务器? :) install.packages('ggplot2') 也没有工作。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-10-09
    • 2015-08-01
    • 2013-04-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多