问题描述
我想在f(file,arg1,arg2)
中的每个文件上运行一个名为dir
的函数。
我想在microbenchmark
中对每个函数进行基准测试。
$a
f("file1",arg2)
$b
f("file2",arg2)
$c
f("file3",arg2)
这样我可以简单地打电话给microbenchmark::microbenchmark(funcs)
?
解决方法
您需要创建未评估表达式的列表。一种实现方法是将[Pipeline] sh
/opt/slave_home/workspace/test1@tmp/durable-de1d1e87/script.sh: 2: /opt/slave_home/workspace/test1@tmp/durable-de1d1e87/script.sh: Bad substitution
+
的参数lapply
建立这些表达式。然后确保将列表固定为bquote
的{{1}}参数。例如
list=
这是一个可重复的例子
microbenchmark()