[S] another newbie question

Roy Pardee (rpardee@netscape.net)
5 Dec 98 16:46:37 PST

First, many thanks to everyone (Hong Ooi, Brian Ripley,
Shawn Boles, Chuck Taylor, Christian Keller, Nick Ellis, and
Naomi Robbins) who helped me out with my first question
(subject: "newbie question") about whether there is a
function that returns the name of an object specified as a
function argument (e.g., so that namefunc(income) would
return "income"). The answer is of course that two functions
used together do this: deparse(substitute()).

In response to my question about whether there was a better
approach to take for line-plotting mean(x) against a y,
grouped by a z, most everyone pointed me to the trellis
function xyplot(). I have been largely successful
plaigairizing the code on page 94 of V&R2.

I have since moved on to my next problem: plotting each
series using a different line type. I have tried:

- specifying "lty =" in the body of xyplot(), giving it
vectors of various lengths,
- altering the trellis.par.get("superpose.line")$lty
parameters, in the same way V&R work with the symbols (see
function below),
- using the trellis.device graphics driver with whatever
default options it sets, and
- using trellis.device("postscript", file = "bubba.ps").

All to no avail (though note that the lines in the key are
drawn as I would have them, no matter which graphics device
I use!). Can anybody out there advise me?

I am using version 3.3 under Win95.

Once again, please reply directly to me at
rpardee@netscape.net & I'll supply a summary to anyone who
asks for it.

Many thanks in advance!


P.S. Here is the function I am using:

statplot <- function(response, abscissa, grouper, statistic)
sps <- trellis.par.get("superpose.symbol")
sps$pch <- 1:7
spl <- trellis.par.get("superpose.line")
spl$lty <- 1:7
trellis.par.set("superpose.symbol", sps)
trellis.par.set("superpose.line", spl)
stats <- aggregate(response, list(abscissa, grouper), statistic)
numcats <- length(unique(grouper))
xyplot(x ~ as.numeric(Group.1),
group = Group.2,
data = stats,
panel = panel.superpose,
type = 'o',
cex = 1.25,
# Note that this doesn't cause an error on my system!
lty = "A",
col = NULL,
key = list(columns = numcats,
text = list(as.character(unique(grouper))),
points =
lines =
cex = 1.25),
xlab = deparse(substitute(abscissa)),
ylab = paste(deparse(substitute(statistic)),

| Roy Pardee | The difference between science |
| Data Wrangler/Analyst | and advocacy is that scientists |
| rpardee@netscape.net | expose their ideas to risk of |
| | falsification. |

More than just email--Get your FREE Netscape WebMail account today at http://home.netscape.com/netcenter/mail
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news