formatR的usage函数意外删除白色

axr492tv  于 2023-02-26  发布在  其他
关注(0)|答案(1)|浏览(109)

formatr中的usage函数意外删除白色。请参阅以下示例:

library(formatR)
library(tidyverse)
usage(
    FUN           = inner_join
  , width         = getOption("width")
  , tidy          = c(TRUE, FALSE)[1]
  , output        = c(TRUE, FALSE)[1]
  , indent.by.FUN = c(TRUE, FALSE)[2]
  , fail          = c("warn", "stop", "none")
)

inner_join(x, y, by = NULL, copy = FALSE, suffix = c(".x", ".y"), ..., keep = FALSE)

但是,我想要这样的东西:

inner_join(
  x,
  y,
  by = NULL,
  copy = FALSE,
  suffix = c(".x", ".y"),
  ...,
  keep = FALSE
)
nfeuvbwi

nfeuvbwi1#

width的反复试验将使您接近您想要的结果:

usage(
  FUN           = inner_join
  , width         = 12
  , tidy          = TRUE
  , output        = TRUE
  , indent.by.FUN = TRUE
  , fail          = "none"
)

#> inner_join(
#>            x,
#>            y,
#>            by = NULL,
#>            copy = FALSE,
#>            suffix = c(".x", ".y"),
#>            ...,
#>            keep = FALSE)

相关问题