Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/loops/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 晶须模板的粘贴方法_R_Loops - Fatal编程技术网

R 晶须模板的粘贴方法

R 晶须模板的粘贴方法,r,loops,R,Loops,我正在编写一个程序来生成循环中的胡须模板,我想把它们粘贴在一起。对于每个模板,我的代码如下所示: script[i] <- whisker.render(template_pdf[i], data = parameter) script[i]当script是可以执行的字符向量时 paste(script, collapse = "\n") do.call(paste, c(script, sep ="\n")) 使用\n(换行符)在脚本元素之间插入的字符 当script是一个列表时,

我正在编写一个程序来生成循环中的胡须模板,我想把它们粘贴在一起。对于每个模板,我的代码如下所示:

script[i] <- whisker.render(template_pdf[i], data = parameter)

script[i]当
script
是可以执行的字符向量时

paste(script, collapse = "\n")
do.call(paste, c(script, sep ="\n"))
使用
\n
(换行符)在脚本元素之间插入的字符


script
是一个列表时,您可以执行以下操作

paste(script, collapse = "\n")
do.call(paste, c(script, sep ="\n"))