Hello,
It is also possible to select by vectors of indices (as opposed to a
vector):
top_n is just to not clutter the display.
library(dplyr)
data(iris)
iris %>% select(1, 3, 4) %>% top_n(5)
iris %>% select(c(1, 3), 4) %>% top_n(5)
Hope this helps,
Rui Barradas
Às 10:05 de 20/08/20, Iv
OK, my bad... I'm sure I had tried it and it didn't work, but I guess
the error was somewhere else...
Thank you!
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evolution
Schloss Monrep
Did you try it?
mydata %>%
select( c( 1, 2, 4 ) )
On August 20, 2020 1:41:13 AM PDT, Ivan Calandra wrote:
>Dear useRs,
>
>I'm still trying to learn tidyverse syntax.
>
>I would like to select() columns based on their positions/indices, but
>I
>cannot find a way to do that (I've seen a lot abou
Dear useRs,
I'm still trying to learn tidyverse syntax.
I would like to select() columns based on their positions/indices, but I
cannot find a way to do that (I've seen a lot about doing that for rows,
but I could not find anything for columns). I thought it would be
obvious, but I cannot find it
4 matches
Mail list logo