[R] xYplot legend keys labels

From: Yasir Kaheil <kaheil_at_gmail.com>
Date: Fri, 02 May 2008 11:47:25 -0700 (PDT)

I came across this little problem in the xYplot function recently and I found it very poorly documented. The legend (keys) in the xYplot is very confusing, especially if you want to change the data labels you have in the data frame column names... say for example you want something with a subscript.
Here is a quick solution to it, by keeping (keys='lines') you need to change the parameter "labels" which belongs to an underlying function of xYplot.

Here is an example

xYplot( Cbind(average,upperErr,lowerErr)~rate,panel=function(x,y,...)

{panel.grid(lty=3,col="black",lwd=0.1);panel.xYplot(x,y,...)},group=type,data=dfr, type="b" ,pch=c(0,1),

        lty=c("dashed","solid"),xlab="Resquest Rate (Request/sec)", ylab="Response Time (millisec)",main="Network Profile A, Class 1, Creation Time",

        labels=c("h",expression(T[i]),"dd","yy"),keys='lines');

There are many other ways to add another legend(s) but I found this to be the easiest as you always need to overwrite the dataframe column names anyway.

-- 
View this message in context: http://www.nabble.com/xYplot-legend-keys-labels-tp17025622p17025622.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help_at_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.
Received on Fri 02 May 2008 - 19:15:58 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 02 May 2008 - 19:30:33 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive