【问题标题】:Remove Scientific Notation from R plot从 R 图中删除科学记数法
【发布时间】:2020-10-29 23:31:50
【问题描述】:

我正在尝试从直方图的 x 轴上删除科学记数法。 options(scipen=999) 不起作用。

感谢您的帮助。

将地块分成不同的块

hist(CatLotData2$'LOT SIZE')

CatLotData2$LotCat <-cut(CatLotData2$'LOT SIZE',
    c(0,1000,2000,3000,4000,5000,6000,7000,8000,9000,10000,12500,15000,17500,Inf))

##I have tried several options to remove scientific notation from the histogram.Below is what I have tried and failed.

plot(CatLotData2$LotCat)

## What I have tried to use and failed.
options(scipen = 999)

options("scipen"=0, "digits"=5)

format(1e03, scientific=FALSE) ## creates output on separate chart 
format(3e03, scientific=FALSE)
format(4e03, scientific=FALSE)

plot(CatLotData2$LotCat)

【问题讨论】:

    标签: r scientific-notation


    【解决方案1】:

    问题在于cut。使用dig.lab 调整数字

    CatLotData2$LotCat <-cut(CatLotData2$'LOT SIZE',
    c(0,1000,2000,3000,4000,5000,6000,7000,8000,9000,10000,12500,
            15000,17500,Inf), dig.lab = 10)
    

    【讨论】:

    • @Pitcrew1001:如果这是您正在寻找的答案,您应该接受它!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-06-27
    • 2023-03-28
    • 1970-01-01
    • 1970-01-01
    • 2020-08-04
    • 1970-01-01
    相关资源
    最近更新 更多