为了生成一个具有某种 struct 的markdown文档,
"Name and ID: %s Authors: %s Date of revision: %s"?
并绕过了
我试过了
reduce(as.list(letters[1:3]),sprintf,fmt="%s %s %s")
如果不起作用,就会抛出错误
Error in fn(out, elt, ...) : too few arguments
我还以为
[1] "a b c"
自那以后
reduce(as.list(letters[1:2]),sprintf,fmt="%s %s")
作品和输出
[1] "a b"
> sessionInfo()
> R version 4.3.2 (2023-10-31 ucrt)
> Platform: x86_64-w64-mingw32/x64 (64-bit)
> Running under: Windows 10 x64 (build 19045)
Matrix products: default
locale:
\[1\] LC_COLLATE=English_United States.utf8 LC_CTYPE=English_United States.utf8 LC_MONETARY=English_United States.utf8
\[4\] LC_NUMERIC=C LC_TIME=English_United States.utf8
time zone: Europe/Paris
tzcode source: internal
attached base packages:
\[1\] stats graphics grDevices utils datasets methods base
other attached packages:
\[1\] purrr_1.0.2
loaded via a namespace (and not attached):
\[1\] compiler_4.3.2 magrittr_2.0.3 cli_3.6.2 tools_4.3.2 rstudioapi_0.15.0 vctrs_0.6.5 lifecycle_1.0.4 rlang_1.1.3
>