Hello R-Users,
I am trying to label points on an xYplot. I can label the points, but
then I lose the error bars. I suspect that I should be using
panel.xYplot rather than panel.xyplot, but that didn't work either...
Can anybody help me out? Example code is below. First xYplot has error
bars, second tries to label the points and the bars disappear.
Thanks,
John
a=c(1:4)
b=rnorm(4,15,5)
blab=b+1
xYplot(Cbind(b, b-1.5, b+1.5)~a,
ylim=c(0,max(b)+3))
xYplot(Cbind(b, b-1.5, b+1.5)~a, ylim=c(0,max(b)+3),
panel=function(x,y,...){
panel.xyplot(x,y,...)
ltext(x=list(1,2,3,4),
y=list(13,14,15,16),
labels=list("A","B","C","D"), pos=2)})
Labeling points with xYplot
10 messages · justin bem, ratna ghosal, Frank E Harrell Jr +3 more
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20081110/87e2d271/attachment.pl>
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?... Nom : non disponible URL : <https://stat.ethz.ch/pipermail/r-help/attachments/20081110/5416c061/attachment.pl>
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20081110/2f082a34/attachment.pl>
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20081110/4d7bc1d5/attachment.pl>
John Poulsen wrote:
Hello R-Users,
I am trying to label points on an xYplot. I can label the points, but
then I lose the error bars. I suspect that I should be using
panel.xYplot rather than panel.xyplot, but that didn't work either...
Can anybody help me out? Example code is below. First xYplot has error
bars, second tries to label the points and the bars disappear.
Thanks,
John
a=c(1:4)
b=rnorm(4,15,5)
blab=b+1
xYplot(Cbind(b, b-1.5, b+1.5)~a,
ylim=c(0,max(b)+3))
xYplot(Cbind(b, b-1.5, b+1.5)~a, ylim=c(0,max(b)+3),
panel=function(x,y,...){
panel.xyplot(x,y,...)
ltext(x=list(1,2,3,4),
y=list(13,14,15,16),
labels=list("A","B","C","D"), pos=2)})
One of the purposes of xYplot is to use panel.xYplot Frank
Frank E Harrell Jr Professor and Chair School of Medicine
Department of Biostatistics Vanderbilt University
Yes, using panel.xYplot is the best thing to do. I couldn't get it to work, which probably means I was specifying it incorrectly. I would be very happy if someone had an example of how to do it. Thanks again -- John
Frank E Harrell Jr wrote:
John Poulsen wrote:
Hello R-Users,
I am trying to label points on an xYplot. I can label the points, but
then I lose the error bars. I suspect that I should be using
panel.xYplot rather than panel.xyplot, but that didn't work either...
Can anybody help me out? Example code is below. First xYplot has
error bars, second tries to label the points and the bars disappear.
Thanks,
John
a=c(1:4)
b=rnorm(4,15,5)
blab=b+1
xYplot(Cbind(b, b-1.5, b+1.5)~a,
ylim=c(0,max(b)+3))
xYplot(Cbind(b, b-1.5, b+1.5)~a, ylim=c(0,max(b)+3),
panel=function(x,y,...){
panel.xyplot(x,y,...)
ltext(x=list(1,2,3,4),
y=list(13,14,15,16),
labels=list("A","B","C","D"), pos=2)})
One of the purposes of xYplot is to use panel.xYplot Frank
That did it! Thanks for the help!!! -- John
David Winsemius wrote:
See if this does what you are expecting.
xYplot(Cbind(b, b-1.5, b+1.5)~a, ylim=c(0,max(b)+3),
panel=function(x,y,...){
panel.xYplot(x,y,subscripts=x,...)
panel.superpose(x,y, subscripts=x, groups=x,...)
ltext(x=list(1,2,3,4),
y=list(13,14,15,16),
labels=list("A","B","C","D"), pos=2)})
---
David Winsemius, MD
Heritage Labs
comes with the usual warrantee... if it breaks you get to keep the parts
On Nov 10, 2008, at 11:26 AM, John Poulsen wrote:
Hello R-Users,
I am trying to label points on an xYplot. I can label the points, but
then I lose the error bars. I suspect that I should be using
panel.xYplot rather than panel.xyplot, but that didn't work either...
Can anybody help me out? Example code is below. First xYplot has
error bars, second tries to label the points and the bars disappear.
Thanks,
John
a=c(1:4)
b=rnorm(4,15,5)
blab=b+1
xYplot(Cbind(b, b-1.5, b+1.5)~a,
ylim=c(0,max(b)+3))
xYplot(Cbind(b, b-1.5, b+1.5)~a, ylim=c(0,max(b)+3),
panel=function(x,y,...){
panel.xyplot(x,y,...)
ltext(x=list(1,2,3,4),
y=list(13,14,15,16),
labels=list("A","B","C","D"), pos=2)})
______________________________________________ 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.
See if this does what you are expecting.
xYplot(Cbind(b, b-1.5, b+1.5)~a, ylim=c(0,max(b)+3),
panel=function(x,y,...){
panel.xYplot(x,y,subscripts=x,...)
panel.superpose(x,y, subscripts=x, groups=x,...)
ltext(x=list(1,2,3,4),
y=list(13,14,15,16),
labels=list("A","B","C","D"), pos=2)})
---
David Winsemius, MD
Heritage Labs
comes with the usual warrantee... if it breaks you get to keep the parts
On Nov 10, 2008, at 11:26 AM, John Poulsen wrote:
Hello R-Users,
I am trying to label points on an xYplot. I can label the points,
but then I lose the error bars. I suspect that I should be using
panel.xYplot rather than panel.xyplot, but that didn't work either...
Can anybody help me out? Example code is below. First xYplot has
error bars, second tries to label the points and the bars disappear.
Thanks,
John
a=c(1:4)
b=rnorm(4,15,5)
blab=b+1
xYplot(Cbind(b, b-1.5, b+1.5)~a,
ylim=c(0,max(b)+3))
xYplot(Cbind(b, b-1.5, b+1.5)~a, ylim=c(0,max(b)+3),
panel=function(x,y,...){
panel.xyplot(x,y,...)
ltext(x=list(1,2,3,4),
y=list(13,14,15,16),
labels=list("A","B","C","D"), pos=2)})
______________________________________________ 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.
ratna ghosal <ratnaghosal <at> yahoo.com> writes:
But then how to interpret the rows and columns........
When lost, use str:
library(nlme)
fm1Orth.lme = lme(distance ~ I(age-11), data = Orthodont,
random = ~ I(age-11) | Subject)
ints = intervals(fm1Orth.lme)
str(ints)
# $ fixed : num [1:2, 1:3] 23.168 0.518 24.023 0.66 24.878 ...
# ..- attr(*, "dimnames")=List of 2
# Estimate of slope
ints$fixed[2,2]
Dieter