Re: [R] Help: barchart() {lattice}

2009-12-04 Thread Xin Ge
Thanks David, it worked! On Fri, Dec 4, 2009 at 10:36 PM, David Winsemius wrote: > > On Dec 4, 2009, at 10:17 PM, Xin Ge wrote: > > @ Francisco: Thanks, it worked. >> >> >> @ All: I'm able to change the colors of legend using following code: >> >> par.settings=simpleTheme(col=c(451,26,652)), >>

Re: [R] Help: barchart() {lattice}

2009-12-04 Thread David Winsemius
On Dec 4, 2009, at 10:17 PM, Xin Ge wrote: @ Francisco: Thanks, it worked. @ All: I'm able to change the colors of legend using following code: par.settings=simpleTheme(col=c(451,26,652)), key=list(space="right", cex=.96, text=list(c("A","B","C")), rectangles=list(size=1.7, border="white"

Re: [R] Help: barchart() {lattice}

2009-12-04 Thread Xin Ge
@ Francisco: Thanks, it worked. @ All: I'm able to change the colors of legend using following code: par.settings=simpleTheme(col=c(451,26,652)), key=list(space="right", cex=.96, text=list(c("A","B","C")), rectangles=list(size=1.7, border="white", col = c(451,26,652))) *Q. Using the foll

Re: [R] Help: barchart() {lattice}

2009-12-04 Thread Francisco J. Zagmutt
Hello Xin, Take a look at the examples under ?print.trellis Using your original example, you could use: require(lattice) p1=barchart(yield ~ variety | site, data = barley, groups = year, layout = c(1,6), ylab = "Barley Yield (bushels/acre)", scales = list(x = list(abb

[R] Help: barchart() {lattice}

2009-12-04 Thread Xin Ge
Hi All, I'm trying par(mfrow(c(1,2))) with barchart(), but its not working. Can I display two or more barcharts on a same page using some other function? I'm using following code --- where barchart() part is taken from help manual. library(lattice) par(mfrow=c(1,2)) barchart(yield ~ variety | sit

Re: [R] Help: barchart() {Lattice}

2009-12-03 Thread Deepayan Sarkar
On Thu, Dec 3, 2009 at 10:02 AM, Felix Andrews wrote: > Either > (1) use the 'alternating' option rather than 'relation' (see > documentation for 'scales' argument); > or > (2) put 'rot' inside the 'y' list if you want it to apply only to the y axis. Or you can have scales = list(y = list(at = y

Re: [R] Help: barchart() {Lattice}

2009-12-02 Thread Peng Cai
Got it, thanks! On Wed, Dec 2, 2009 at 11:32 PM, Felix Andrews wrote: > Either > (1) use the 'alternating' option rather than 'relation' (see > documentation for 'scales' argument); > or > (2) put 'rot' inside the 'y' list if you want it to apply only to the y > axis. > > > > 2009/12/3 Peng Cai

Re: [R] Help: barchart() {Lattice}

2009-12-02 Thread Felix Andrews
Either (1) use the 'alternating' option rather than 'relation' (see documentation for 'scales' argument); or (2) put 'rot' inside the 'y' list if you want it to apply only to the y axis. 2009/12/3 Peng Cai : > Hi Felix and Others, > > I just realized, after using relation="free" option, my y-axi

Re: [R] Help: barchart() {Lattice}

2009-12-02 Thread Peng Cai
Hi Felix and Others, I just realized, after using relation="free" option, my y-axis labels got rotated by 90 degree. Previously they were horizontal and now they are vertical. I tried using "rot=" option but it rotates both x and y-axis labels at the same time. Any suggestions, I'm trying: scale

Re: [R] Help: barchart() {Lattice}

2009-12-02 Thread Peng Cai
Got it thanks, (relation="free" worked), more specifically scales = list(relation="free", y = list(at = yScale)) On Wed, Dec 2, 2009 at 6:04 PM, Felix Andrews wrote: > 2009/12/3 Peng Cai : > > Hi Felix, > > > > Thanks for your help. If I'm defining my own y-scales like the one in R > code > > b

Re: [R] Help: barchart() {Lattice}

2009-12-02 Thread Felix Andrews
2009/12/3 Peng Cai : > Hi Felix, > > Thanks for your help. If I'm defining my own y-scales like the one in R code > below, then can I remove right side tick marks? Yes. Look at the description of the "scales" argument in ?xyplot > > dta<-read.table("data.txt", header=TRUE, row.names="Names") > l

Re: [R] Help: barchart() {Lattice}

2009-12-02 Thread Peng Cai
Hi Felix, Thanks for your help. If I'm defining my own y-scales like the one in R code below, then can I remove right side tick marks? dta<-read.table("data.txt", header=TRUE, row.names="Names") library(lattice) yScale <- seq(-200, 200, 10) barchart(data.matrix(dta), horizontal=FALSE,

Re: [R] Help: barchart() {Lattice}

2009-12-02 Thread Felix Andrews
2009/12/3 Peng Cai : > Hi R Users, > > I'm using following data/code (data is attached also) to produce a stacked > barplot. > > # Sample Data: > Names Col1 Col2 Col3 > Row1 -20 40 -10 > Row2 30 -20 40 > Row3 30 10 -20 > Row4 20 20 -10 > > > # R Code: > dta<-read.table("data.txt", header=TRUE, row.

[R] Help: barchart() {Lattice}

2009-12-02 Thread Peng Cai
Hi R Users, I'm using following data/code (data is attached also) to produce a stacked barplot. # Sample Data: Names Col1 Col2 Col3 Row1 -20 40 -10 Row2 30 -20 40 Row3 30 10 -20 Row4 20 20 -10 # R Code: dta<-read.table("data.txt", header=TRUE, row.names="Names") barchart(data.matrix(dta),