更改 R 中格子密度图 Y 轴上的科学记数法

Changing Scientific notation on Y axis of Lattice density plot in R

我刚开始学习 R,我有一个相当基本的问题....

这是一些示例代码 -

library(MASS)
library(lattice)
Tbirthwt <- MASS::birthwt

par(mar=c(4,6,2,2))
densityplot(~bwt , group=factor(race), data = Tbirthwt,lwd=3,xlab="Weight in 
Grams",
        auto.key=T, 
        main="Birth Weight Children by Mothers \nRace:(1=White,2=Black,3=other)")

结果图的 Y 轴采用科学记数法。我如何将其从科学记数法转换?

感谢任何帮助。 谢谢你。 -巴里

您可以通过调整 scipen 来做到这一点。

options(scipen = 999)