r - 如何在 RStudio 中查找并替换为新行(不是新行字符)?

标签 r rstudio

假设我们在脚本 Pane 中有以下内容

size = 1, minSize = 0, gridSize = 0, fontFamily = "Segoe UI", 
fontWeight = "bold", color = "random-dark", backgroundColor = "white"

我们想要 cmd + f 并找到所有 , - 即逗号后跟一个空格(技术上也可以是逗号后跟)在行尾),然后用一个新行替换它们(即相当于按 Enter 键),所以我们最终会得到类似的内容

size = 1
minSize = 0
gridSize = 0
fontFamily = "Segoe UI" 
fontWeight = "bold"
color = "random-dark"
backgroundColor = "white"

这是如何完成的?

注:similar question (不需要更换新行)

最佳答案

给你,

  1. 按如下所示进行操作:

enter image description here

  • 按“全部”按钮。完成,结果如下:
  • enter image description here

    关于r - 如何在 RStudio 中查找并替换为新行(不是新行字符)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61290598/

    相关文章:

    r - 如何让 Rmarkdown 包含源脚本打开的窗口中的绘图?

    r - 使用带有引用书目样式的 natbib 的 RStudio 进行引用时出现问题

    r - 使用 geom_line 的 ggplot 中的时间序列

    R 演示文稿 - 带有 Web 链接的引用 css 模板

    r - 将 geom_smooth 添加到箱线图

    string - 从R中的字符串中删除html标签

    r - 警告 : some observed variances are (at least) a factor 1000 times larger than others; use varTable(fit) to investigate

    python - R 网状包在 winpython 中看不到 keras 库

    r - `Sys.which` 在 RStudio 中找不到可执行文件

    css - 更改 RStudio 主题中的不可见(白色字体)输出 `Cobalt`