Skip to content
Back to formatted view

Raw Message

Message-ID: <OFEEF6448E.39F35E54-ON852575BA.0066AFFE-852575BA.0066C841@nps.gov>
Date: 2009-05-18T18:42:39Z
From: Steve_Friedman at nps.gov
Subject: Superscripts and subscripts in trellis graphics
In-Reply-To: <971536df0905180745nfb425e0gceb3e73b49db251b@mail.gmail.com>

Gabor's solution has worked very nicely.

Thank you very much.

Steve Friedman Ph. D.
Spatial Statistical Analyst
Everglades and Dry Tortugas National Park
950 N Krome Ave (3rd Floor)
Homestead, Florida 33034

Steve_Friedman at nps.gov
Office (305) 224 - 4282
Fax     (305) 224 - 4147


                                                                           
             Gabor                                                         
             Grothendieck                                                  
             <ggrothendieck at gm                                          To 
             ail.com>                  Steve_Friedman at nps.gov              
                                                                        cc 
             05/18/2009 10:45          r-help at r-project.org                
             AM AST                                                Subject 
                                       Re: [R] Superscripts and subscripts 
                                       in trellis graphics                 
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




Try:

R2 <- -0.18
panel.text(label = bquote(R^2 == .(R2)), ...


On Mon, May 18, 2009 at 10:25 AM,  <Steve_Friedman at nps.gov> wrote:
>
> I'd like to annotate an xyplot with an R^2 value, but can not find the
> syntax to define the superscript format for the text.
>
> I'd appreciate suggestions,
>
> xyplot(SharkSloughEggs.df$Sharkeggs.rel +
> SharkSloughEggs.df$SharkHatched.rel + SharkSloughEggs.df$SharkFlooded.rel
+
> HSI.shark$MEAN ~ Year,
> ? ? ? ? ? pch=c(1,9,5,4), lty=c(1,6,3,4), lwd = c(2), col = c("black",
> "blue", "green", "red"),
> ? ? ? ? ? scales=list(tick.number=length(Year)), data=SharkSloughEggs.df,
> ylab="Relative Egg Success",
> ? ? ? ? ? main="Shark Slough Alligators",
> ? ? ? ? ? par.settings = graph.sets, ?type = "b")
> ? ? ? ? ? ? ? ? trellis.focus()
> ? ? ? ? ? ? ? ? ? ?panel.text(x=1999, y = 0.95, labels="Hatched Eggs\nR^2
> = -0.18", cex = 0.75)
> ? ? ? ? ? ? ? ? ? ?panel.text(x=1998, y = 0.35, labels="Number of
> Eggs\nR^2 = 0.43",cex = 0.75)
> ? ? ? ? ? ? ? ? ? ?panel.text(x=1995, y = 0.25, labels="Flooded Eggs\nR^2
> = -0.50", cex = 0.75)
> ? ? ? ? ? ? ? ? ? ?panel.text(x=1986, y = 0.3, labels="Mean HSI", cex =
> 0.75)
> ? ? ? ? ? ? ? ? trellis.unfocus()
>
>
> Thanks
> Steve
>
>
> Steve Friedman Ph. D.
> Spatial Statistical Analyst
> Everglades and Dry Tortugas National Park
> 950 N Krome Ave (3rd Floor)
> Homestead, Florida 33034
>
> Steve_Friedman at nps.gov
> Office (305) 224 - 4282
> Fax ? ? (305) 224 - 4147
>
> ______________________________________________
> 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.
>