Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201839

Creating a function which creates a vector without needing quotation marks for strings

$
0
0

I know that dplyr select has the ability to subset a dataset using column names without quotation marks:

function (.data, ...) 
{
    UseMethod("select")
}

I would like to do something similar, but instead of subsetting, I want the function to create a vector. Something like:

var_select <- function (...) {
    UseMethod("select")
}
vector  <-var_select(cyl, disp, hp)
> vector
[1] "cyl""disp""hp"

What would be the correct syntax for this?


Viewing all articles
Browse latest Browse all 201839

Trending Articles