How about the following:
tst <- 1:2
Plot.function <-
function(x){
xName <- deparse(substitute(x))
Main <- paste('Plot of', xName)
plot(x, main=Main)
}
Plot.function(tst)
Does this do what you want?
Spencer Graves
Todd Hatfield wrote:
I'd like to be able to use an object's name as the title in plotting
functions. Is there a way to capture the name of an object as a character
string?
(I'm using: Professional Edition Version 6.1.2 Release 1 for Microsoft
Windows : 2002)
Thanks for any help!
Todd Hatfield
--------------------------------------------------------------------
This message was distributed by s-news@lists.biostat.wustl.edu. To
unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
the BODY of the message: unsubscribe s-news
|