ManInMoon wrote:
I have writtn a function where I pass a variable number of arguments.

I They are vectors and I can manipulate them, but I need to get hold of the
name for a legend.

niceplot<-function(...) {
   parms=list(...)

  for (x in parms) {
    DoSomethingWith(x)
  }

}

BUT how how can I get something like namestring(...) of nameofvector(x)?


I use the following syntax to get the name of a data object to use in a title, label or whatever.

xname <- paste(deparse(substitute(x), 500), collapse = "\n")

This is taken from hist.default so at least has some provenance as an appropriate method.

David Scott

--
_________________________________________________________________
David Scott     Department of Statistics
                The University of Auckland, PB 92019
                Auckland 1142,    NEW ZEALAND
Phone: +64 9 923 5055, or +64 9 373 7599 ext 85055
Email:  d.sc...@auckland.ac.nz,  Fax: +64 9 373 7018

Director of Consulting, Department of Statistics

______________________________________________
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