Tryu this: deparse(substitute(mtcars))
On Wed, Aug 4, 2010 at 8:47 AM, Liviu Andronic <landronim...@gmail.com>wrote: > Dear all > Is there an easier way to retrieve the name of an object? For example, > > tmp <- 1:10 > > as.character(quote(tmp)) > [1] "tmp" > > as.character(quote(mtcars$cyl)) > [1] "$" "mtcars" "cyl" > > as.character(quote(mtcars$cyl))[3] > [1] "cyl" > > The last call more than anything seems a hack. Is there a better way? > > Thank you > Liviu > > ______________________________________________ > 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. > -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40" S 49° 16' 22" O [[alternative HTML version deleted]]
______________________________________________ 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.