Skip to content

Instantly share code, notes, and snippets.

@kevinushey
Created May 29, 2013 20:45
Show Gist options
  • Save kevinushey/5673704 to your computer and use it in GitHub Desktop.
Save kevinushey/5673704 to your computer and use it in GitHub Desktop.
a <- 1
b <- 2
f <- function(x) {
call <- match.call()
len <- length( call[[2]] )
output <- x
names(output) <- sapply( call[[2]][2:len], as.character )
return(output)
}
f( c(a, b) )
x <- 10
f( c(a, b, x) )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment