s-news
[Top] [All Lists]

Using "arguments" of a function as part of a title for a plot?

To: s-news@wubios.wustl.edu
Subject: Using "arguments" of a function as part of a title for a plot?
From: Savitri Appana <saviappana@yahoo.com>
Date: Fri, 28 Jan 2005 12:53:06 -0800 (PST)
Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=ZM50y3KF+gI6xxUmJ9BxWhh4Lm6KJ1BqXrSbSDOF6aW76rlcsU+UuGny5Gnng+caAAoLap9dwR9lRqv72VNrW1wRlfcY6nh+29d8NaCTyNPetAdZNsqG4/5YkmUTaqZH8at8mURb/+i87W4f+Svsuy+SZCr03Bq3RjtYKseyBR0= ;
Hello S+ users,

I have to generate several plots so i created a simple
function which takes in as arguments "data", "x", and
"y" (see below).  Now i would like to be able to put
the actual "data" name as part of the subtitle (sub =
"data" ?).  How can i do this in S+ ?   Also, is it
possible to change the position of the subtitle (say
from 'bottom' to 'top' below the main title? 


myPlot <- function(dat, x, y) {
        attach(dat)
        ## par(mfrow = c(3,2))
        plot(x, y, main = "Smoothing splines", 
             sub = ?????)
        lines(smooth.spline(x, y))
}
myPlot(myDat, hrs, pres)

final result:  a plot with a main title and sub title
as such:

              "Smoothing splines" 
                   "myDat"
               [    plot       ]

:)

Any suggestions are much appreciated...
Thanks in advance,
Savi



                
__________________________________ 
Do you Yahoo!? 
The all-new My Yahoo! - Get yours free! 
http://my.yahoo.com 
 


<Prev in Thread] Current Thread [Next in Thread>