Hello
I was wondering if there is a way to select multiple variables while writing a code. I mean when we type the dataframe name followed by $, we get the list of all variables but it only allows selecting one at a time.
Is there a way (like a package or rstudio add in) that allows selecting multiple?
what I have been doing so far is (and I got the ideas from this 2012 post ):
use dput(names(dataframe)) then select what I need
use starts_with, ends_with, contains, etc... from dplyr (but these only work whenever there is a unique pattern to the variables of interest).
with all these nice rstudio add ins around, I was hoping there is a nicer/ more efficient way to select the variables without having to type them individually.
this sounds like a basic question and I apologize in advance if it has been asked before but I could not find an answer here or on stackoverflow.
Oh, I see. I must have misunderstood your initial question. In the stackoverflow link you have posted, they are suggesting the select.list() function, isn't that what you want?
I suppose you could use it like so: