3/02/11 @ 11:25 (-0500), David Winsemius escriu:
> On Feb 3, 2011, at 10:27 AM, Ernest Adrogué wrote:
> 
> >Hi,
> >Suppose a function that checks an object:
> >
> >stop.if.dims <- function(x) {
> > if (! is.null(dim(x))) {
> >   stop("cannot handle dimensional data")
> > }
> >}
> >
> 
> > mtx <- matrix(c(1,0,0,1), 2)
> > stop.if.dims <- function(x) { objname <- deparse(substitute(x))
> +  if (! is.null(dim(x))) {
> +    stop(paste(objname,"cannot handle dimensional data") )
> +  }
> + }
> > stop.if.dims(mtx)
> Error in stop.if.dims(mtx) : mtx cannot handle dimensional data

Here, "mtx" is the name of the argument that stop.if.dims gets.
What I want is name of the function that calls stop.if.dims.

That being said, I was also interested in getting the names
of arguments, so thanks :) 

Cheers.
-- 
Ernest

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to