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.
我正在尝试实现 magrittr 的管道语法并很早就陷入困境。我已经阅读了我可以在网上找到的所有内容,但我只是看不到如何通过%>%函数传递命名参数。
%>%
我想:
Nsamp+2 %>% seq(0, 1, length.out = .)
做同样的事情:
seq(0,1,length.out=Nsamp+2)
正如@Victorp 指出的那样
Nsamp <- 3 (Nsamp + 2) %>% seq(0, 1, length.out = . ) # [1] 0.00 0.25 0.50 0.75 1.00
应该可以正常工作。