我想要制作
list(quote(10^2), quote(10^3), quote(10^4),
quote(10^5), quote(10^6), quote(10^7))
来自
seq(2,7)
有没有比那种方法更好的方式?
mapply(function(n) substitute(10^x, list(x=as.double(n))), seq(2,7))
我已经尝试了以下方法:
> substitute(10^x, list(x=seq(2,7)))
10^2:7
> mapply(substitute, 10^x, x=seq(2,7))
Error in mapply(substitute, 10^x, x = seq(2, 7)) : object 'x' not found
> mapply(function(n) substitute(10^n), seq(2,7))
list(10^dots[[1L]][[6L]], 10^dots[[1L]][[6L]], 10^dots[[1L]][[6L]],
10^dots[[1L]][[6L]], 10^dots[[1L]][[6L]], 10^dots[[1L]][[6L]])
as.numeric
。 - zwolbquote
是否比substitute
更有优势吗? - A5C1D2H2I1M1N2O1R2T1bquote
使用substitute
。 - G. Grothendieck