[R] Ordering scales in xYplot.Hmisc

Jose A. Hernandez jahernan at umn.edu
Fri Apr 1 20:41:06 CEST 2005


Dear R community,

I am using xYplot() from the Hmisc package. The package works great to 
plot means + CI. But I am having issues handling the scales.

I am plotting "Soil Clay content" vs "Soil depth" by "land use".

Usually in this type of graphs it is better to place the variable "soil 
depth" in the y-axis and it should be ordered downward by depth (0-5 cm, 
5-10 cm, 10-20 cm).

I can't figure out how to sort/order the scale to obtain the graph I 
need, any insights will be appreciated.

Best regards and have a nice weekend,

Jose

 > version
          _
platform i386-pc-mingw32
arch     i386
os       mingw32
system   i386, mingw32
status
major    2
minor    0.1
year     2004
month    11
day      15
language R

################ CODE #####################
library(Hmisc)
ron <- read.csv("http://www.tc.umn.edu/~jahernan/ron.csv")
ron
#sapply(ron,class)

ron$depth <- factor(ron$depth)
levels(ron$depth) <- c("0-5", "5-10", "10-20")
ron

Dotplot(depth ~ Cbind(clay_mean,clay_lower,clay_upper) |land,
         data=ron,
         xlim=c(22,36),
         ylab="Soil Depth [cm]",
         xlab="Clay Content [%]",
         main=c("Clay Content by Soil Depth and Land Use. Rondonia,
         Brasil"))
################ CODE #####################


-- 
Jose A. Hernandez
Ph.D. Candidate
Precision Agriculture Center

Department of Soil, Water, and Climate
University of Minnesota
1991 Upper Buford Circle
St. Paul, MN 55108

Ph. (612) 625-0445, Fax. (612) 625-2208




More information about the R-help mailing list