[R] Superscripts and subscripts in trellis graphics

Steve_Friedman at nps.gov Steve_Friedman at nps.gov
Mon May 18 16:25:14 CEST 2009


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




More information about the R-help mailing list