【发布时间】:2014-04-03 09:26:09
【问题描述】:
假设我有两个花车
a <- 8.9384920e-24
b <- 0.00293892837
我想在图表上以 10 基科学记数法显示它们中的任何一个,四舍五入到小数点后两位,可能使用 paste(),但在 10 之后使用上标格式。
8.94 x 10^-24 #no ^ and superscript font
2.94 x 10^-4 #no ^ and supercript font, should be -4, not -04
这真的很疯狂,但它已被上级要求,它必须在基础 R(而不是 ggplot2)中完成,否则我将不得不重新编写 600 行代码......现在我能看到的是根据它们的大小,浮动的打印方式会有所不同......
【问题讨论】:
标签: r formatting notation