I am trying to implement magrittr's piping syntax and getting stuck very early. I have read everything I can find on it online but I just don't see how to pass named arguments though the %>% function.
I would like:
Nsamp+2 %>% seq(0, 1, length.out = .)
To do the same as:
seq(0,1,length.out=Nsamp+2)
As @Victorp pointed out
Nsamp <- 3
(Nsamp + 2) %>% seq(0, 1, length.out = . )
# [1] 0.00 0.25 0.50 0.75 1.00
should work just fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With