Dear list,
   
   Is there a way to reorder the xaxis using lattice. Using the following data, 
the x-axis is ordered as BP GH MH PF RE RP SF VT but I would like the x-axis to 
be ordered as PF RP BP GH VT SF RE MH.
   
    Kön         Skalor     Tillfälle Medelvärde
1  Kvinnor     BP 1-inskrivning   36.45283
2  Kvinnor     GH 1-inskrivning   38.62255
3  Kvinnor     MH 1-inskrivning   62.88889
4  Kvinnor     PF 1-inskrivning   39.80710
5  Kvinnor     RE 1-inskrivning   41.50943
6  Kvinnor     RP 1-inskrivning   22.22222
7  Kvinnor     SF 1-inskrivning   59.19811
8  Kvinnor     VT 1-inskrivning   34.84568
9  Kvinnor     BP 2-utskrivning   43.14815
10 Kvinnor     GH 2-utskrivning   44.11321
11 Kvinnor     MH 2-utskrivning   77.22222
12 Kvinnor     PF 2-utskrivning   44.74280
13 Kvinnor     RE 2-utskrivning   68.95425
14 Kvinnor     RP 2-utskrivning   39.90385
15 Kvinnor     SF 2-utskrivning   64.62264
16 Kvinnor     VT 2-utskrivning   51.97531

   
  bwplot(Medelvärde ~ Skalor| Kön , kt, panel = "panel.superpose",
       groups = Tillfälle,scales = list(x = list(rot = 
45),cex=0.7,alternating=2),
       panel.groups = 
"panel.linejoin",lty=c(1:3),lwd=3,col=c("steelblue","grey50","green4"),
       ylab = list(label = "skalpoäng (0-100)", cex = 0.8),
       xlab = list(label = "skalor", cex = 0.8),
       key = list(lines = 
Rows(list(col=c("steelblue","grey50","green4"),lty=c(1:3)),
                c(1:3, 0)),cex=0.8,text = list(lab = 
as.character(unique(kt$Tillfälle))),
                  columns = 2, title = "SF-36: Skalpoäng för respektive kön vid 
3 mättillfälle ",
                  cex.title=0.9))
   
  Thanks in advance,
  Tom

       
---------------------------------

Jämför pris på flygbiljetter och hotellrum: 
http://shopping.yahoo.se/c-169901-resor-biljetter.html
        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to