search for: evaluatedargs

Displaying 2 results from an estimated 2 matches for "evaluatedargs".

2011 Jan 14
1
Help on a Display function
> I wanted to simulate the Matlab DISPLAY function for some time now. After seeing a recent proposal by Gabor Grothendieck I came up with the following solution, display <- function(...) { my_names <- lapply(substitute(placeholderFunction(...))[-1], deparse) for (my in my_names) cat(my, "=", eval(parse(text=my)), "\n", sep=" ") } that works about as
2011 Sep 15
2
Returning the name of an object passed directly or from a list by lapply
Dear folks: Let?s suppose I want a function to print return the name of the object passed to it. > myname <- function(object) {out<-deparse(substitute(object)); out} This works fine on a single object: > O1 <-c(1:4) > myname(O1) [1] "O1" However it does not work if you use lapply to pass it the same object from a list: > O2 <-c(1:4) > object.list <-