Skip to content
Prev 69677 / 398525 Next

List and Column Names in a Function?

In this simple function, how can I pass strings for index and column names
to the function?  I've posted this type of question before and received no
response.

Maybe this example will be easier to understand and troubleshoot.

ds <- function(myds, vec) {myds[[vec]]*2}

ds1 <- c(X=list(1:10), Y=list(11:20))

ds(get("ds1"),get("Y"))


khobson at odot.org
Kenneth Ray Hobson, P.E.
Oklahoma DOT - QA & IAS Manager
Oklahoma City, OK  73105-3204