Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
v <- runif(100, 0, 10) seq(???(round(range(v))), length.out=5)
有便利功能吗???或以最少的击键次数完成此操作的其他方式——尤其是在交互工作时。
您正在寻找do.call
do.call
do.call(seq,c(round(range(v)),list(length.out=5)))
您需要使用c(...,list(OtherArgs))将所有参数组合到一个列表中。
c(...,list(OtherArgs))
但是,如果我想在交互工作时用最少的击键来做到这一点,我可能会用“硬”的方式来做:
rv <- round(range(v)) seq(rv[1],rv[2],length.out=5)
(56 对 51 次击键,但要跟踪的嵌套括号更少,两个短命令可能比一个长命令更容易)