小编bio*_*ard的帖子

强制R将科学记数写为n.nn x 10 ^ -n with superscript

假设我有两个花车

a <- 8.9384920e-24
b <- 0.00293892837
Run Code Online (Sandbox Code Playgroud)

我想在图表中以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
Run Code Online (Sandbox Code Playgroud)

这真是疯子,但它已被上级要求,它必须在基地R(不是ggplot2)中完成,否则我将不得不重新编写600行代码......现在我只能看到浮点数是根据它们的大小而不同地印刷...

formatting r notation

3
推荐指数
1
解决办法
1079
查看次数

R:对"+"字符不能grep()吗?

这是我的数据:

> rep$strand
  [1] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  [58] - - - - - - - - - - - - - - - - - - …
Run Code Online (Sandbox Code Playgroud)

regex r grepl

1
推荐指数
1
解决办法
89
查看次数

在 y 轴 ggplot2 上指定刻度线

这是我的test数据的样子(这是假数据):

   Var1 Var2     value
1     A   -7 0.7239130
2     C   -7 0.8326087
3     G   -7 0.7891304
4     U   -7 0.8543478
5     A   -6 0.7673913
6     C   -6 0.8326087
7     G   -6 0.7673913
8     U   -6 0.8326087
9     A   -5 0.8543478
10    C   -5 0.7239130
11    G   -5 0.8760870
12    U   -5 0.7456522
13    A   -4 0.8108696
14    C   -4 0.7456522
15    G   -4 0.8108696
16    U   -4 0.8326087
17    A   -3 0.8543478
18    C   -3 0.7456522
19    G …
Run Code Online (Sandbox Code Playgroud)

axis r ggplot2

1
推荐指数
1
解决办法
1万
查看次数

bash - 用sed替换字符串

出于某种神秘的原因,我的CSV数据中的某些元素显示为s/stWgvN52??f2&amp; ?&quot;代替stWgvN522tw0JtZZnyXj,因为我将其;设置为CSV分隔符,因此会混淆文件.

我尝试使用sed以下方法替换有缺陷的字符串:

$ sed -i 's/stWgvN52??f2&amp; ?&quot;/stWgvN522tw0JtZZnyXj/g' file.csv
Run Code Online (Sandbox Code Playgroud)

但是我收到以下错误:sed:1:"access_logs_2014-04.csv":命令a期望\后跟文本

是什么原因?

csv bash sed

1
推荐指数
1
解决办法
716
查看次数

标签 统计

r ×3

axis ×1

bash ×1

csv ×1

formatting ×1

ggplot2 ×1

grepl ×1

notation ×1

regex ×1

sed ×1