Skip to content

Instantly share code, notes, and snippets.

@i-like-bikes
Last active September 26, 2017 04:58
Show Gist options
  • Save i-like-bikes/beb47caa068cee9116395748363bdf15 to your computer and use it in GitHub Desktop.
Save i-like-bikes/beb47caa068cee9116395748363bdf15 to your computer and use it in GitHub Desktop.
searchCols = vector('list', ncol(mtcars))
q = list('gear'=3, 'mpg'=10)
colNames = names(mtcars)
for(col_ in names(q)) {
pos = which(colNames == col_)
searchCols[[pos]] <- list(search = q[[col_]])
}
searchCols
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment