小编Rle*_*ner的帖子

如何使用已计算的值在 ggplot2 图上绘制 95 百分位数和 5 百分位数?

我有这个数据集并使用这个 R 代码:

library(reshape2)
library(ggplot2)
library(RGraphics)
library(gridExtra)

long <- read.csv("long.csv")
ix <- 1:14

ggp2 <- ggplot(long, aes(x = id, y = value, fill = type)) +
    geom_bar(stat = "identity", position = "dodge") +
    geom_text(aes(label = numbers), vjust=-0.5, position = position_dodge(0.9), size = 3, angle = 0) +
    scale_x_continuous("Nodes", breaks = ix) +
    scale_y_continuous("Throughput (Mbps)", limits = c(0,1060)) +
    scale_fill_discrete(name="Legend",
                        labels=c("Inside Firewall (Dest)",
                                 "Inside Firewall (Source)",
                                 "Outside Firewall (Dest)",
                                 "Outside Firewall (Source)")) +
    theme_bw() +
    theme(legend.position="right") +
    theme(legend.title = …
Run Code Online (Sandbox Code Playgroud)

r percentile ggplot2

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

如何在 UNIX / Linux 操作系统下使用 sed 替换带有换行符 (\n) 的模式?

我有一个 txt 文件,其中包含:

Some random
text here. This file
has multiple lines. Should be one line.
Run Code Online (Sandbox Code Playgroud)

我用:

sed '{:q;N;s/\n/:sl:/g;t q}' file1.txt > singleline.txt
Run Code Online (Sandbox Code Playgroud)

并得到:

Some random:sl:text here. This file:sl:has multiple lines. Should be one line.
Run Code Online (Sandbox Code Playgroud)

现在我想:sl:newline (\n)字符替换模式。当我使用时:

sed 's/:sl:/&\n/g' singleline.txt
Run Code Online (Sandbox Code Playgroud)

我得到:

Some random:sl:
text here. This file:sl:
has multiple lines. Should be one line.
Run Code Online (Sandbox Code Playgroud)

如何用换行符替换模式而不是在模式后添加换行符?

unix text replace newline sed

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

标签 统计

ggplot2 ×1

newline ×1

percentile ×1

r ×1

replace ×1

sed ×1

text ×1

unix ×1