[R] greek symbols on ylab=

2010-03-18 Thread Peng Cai
] Concentration ("*mu*g/m^3*")"\n(random text in brackets)) Square brackets doesn't seem to work because I'm using them in "" and \n operator is not working too. Any help would be highly appreciated, thanks, Peng Cai [[alternative HTML version deleted]]

Re: [R] Adding text outside (lattice barchart) plotting region.

2010-03-17 Thread Peng Cai
region parameters for lattice plots (though I'm aware of how to change these). Thanks, Peng Cai On Wed, Mar 17, 2010 at 7:27 PM, Jim Lemon wrote: > On 03/18/2010 09:50 AM, Peng Cai wrote: > >> Hi All, >> >> I need some help with adding text at the bottom of the graph (

[R] Adding text outside (lattice barchart) plotting region.

2010-03-17 Thread Peng Cai
like this: ___ | | | Plot | |___ __| 1931 1932 Month: 01 04 # R code require(lattice) barchart(yield ~ year, data = barley, stack=TRUE, col="black", ylim=c(0,85) ) Can anyone help please, thanks in advance, Peng Cai

Re: [R] bwplot() {lattice}

2010-03-02 Thread Peng Cai
Thanks Deepayan ! On Sun, Feb 28, 2010 at 2:08 PM, Deepayan Sarkar wrote: > On Sat, Feb 27, 2010 at 8:14 PM, Peng Cai > wrote: > > Thanks a lot Deepayan, one question: > > > > Is it possible to place these barplots side-by-side instaed of super > > imposing?

Re: [R] bwplot() {lattice}

2010-02-27 Thread Peng Cai
= panel.superpose, panel.groups = panel.bwplot, auto.key=list(space="right"), groups = year, scales=(x=list(rot=45))) Thanks, Peng On Fri, Feb 26, 2010 at 3:51 AM, Deepayan Sarkar wrote: > On Fri, Feb 26, 2010 at 8:30 AM, Peng Cai > wrote: > > Hi All, > > &g

[R] bwplot() {lattice}

2010-02-25 Thread Peng Cai
Hi All, I'm trying to plot boxplot graph. I tried barchart with "groups=" option and it worked fine. But when I try to generate same kind of graph using bwplot(), "groups=" option doesn't seem to work. Though this works, yield ~ variety | site * year I'm thinking why "groups=" doesn't work in th

[R] expression() help

2010-02-12 Thread Peng Cai
Hi All, I'm trying to use expression() for y-label in plot(). I'm not able to write Average(space)PM(subscript)10. I'm trying: ylab=expression(Average PM[10]) and its not working, because of a space between "Average" and "PM". Thanks, Peng [[alternative HTML version deleted]] _

Re: [R] Lattice boxplots

2009-12-19 Thread Peng Cai
Thanks Richard. Which function I should explore in HH package to get such boxplot? Peng On Sat, Dec 19, 2009 at 6:06 PM, Richard M. Heiberger wrote: > The grouped boxplot is one of the features included in the HH package. > An example is posted on my site > http://astro.ocis.temple.edu/~rmh/HH/b

[R] Lattice boxplots

2009-12-19 Thread Peng Cai
mpact boxplot for publication. Having legend can help because otherwise x-axis labels are repeated for each rectanglular box. Thanks, Peng Cai [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/ma

[R] re-ordering labels issue using barchart().

2009-12-09 Thread Peng Cai
", scales = list(x = list(rot = 45))) Thanks alot, Peng Cai [[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

Re: [R] Greek symbols on "ylab=" using barchart() {Lattice}

2009-12-09 Thread Peng Cai
Thanks, it worked! On Wed, Dec 9, 2009 at 12:46 PM, baptiste auguie < baptiste.aug...@googlemail.com> wrote: > barchart(1:2, ylab=expression("Concentration ("*mu*g/m^3*")")) > > 2009/12/9 Peng Cai : > > Hi Baptiste and Others, > > > > Thank

Re: [R] Greek symbols on "ylab=" using barchart() {Lattice}

2009-12-09 Thread Peng Cai
Hi Baptiste and Others, Thanks for your help. I'm writing: ylab=expression(Concentration(mu*g/m^3)) And its working fine, but is it possible to add a space between "Concentration" and "(mu*g/m^3)". Thanks again, Peng Cai On Wed, Dec 9, 2009 at 12:02 PM, bapti

[R] Greek symbols on "ylab=" using barchart() {Lattice}

2009-12-09 Thread Peng Cai
g barchart() from "Lattice". Can anyone help please? Thanks, Peng Cai [[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

Re: [R] barchart() {lattice} help.

2009-12-06 Thread Peng Cai
18 Female White 9 15--18 Male Black 21 15--18 Male Other 2 15--18 Male White 3 5--14 Female Black 138 5--14 Female Other 31 5--14 Female White 23 5--14 Male Black 199 5--14 Male Other 65 5--14 Male White 29 Thanks, Peng On Sun, Dec 6, 2009 at 11:47 AM, Peng Cai wrote: >

Re: [R] barchart() {lattice} help.

2009-12-06 Thread Peng Cai
31 5--14 Female White 23 5--14 Male Black 199 5--14 Male Other 65 5--14 Male White 29 Thanks, Peng On Sun, Dec 6, 2009 at 11:18 AM, Gary Miller wrote: > Thanks Uwe, I got your suggestions part too. > > 2009/12/6 Uwe Ligges > > > > > > > Peng Cai wrote: > > > &

[R] barchart() {lattice} help.

2009-12-05 Thread Peng Cai
Hi, I'm plotting grouped barplot using following code and data. I need help with re-ordering the labels. 1. On x-axis the factor "AGE" is grouped in order "0--4", "15--18", "5--14"; whereas I would like to have it in "0--4", "5--14", "15--18". 2. If I need to re-order "RACE" variable. How can I

Re: [R] Dataframe help

2009-12-03 Thread Peng Cai
Try this: both <- merge(left, right, by.x="column1", by.y="column1") left dataset column1column2 121 12345 145 1675 167 2765 right datset column1 column3 121abc 345lmn 167efg HTH, Peng On Thu, Dec 3, 2009 at 2:47 PM, Ramya wrote: > > Hi there > > I

Re: [R] Two-way/Three-way sum.

2009-12-03 Thread Peng Cai
Thanks again! On Thu, Dec 3, 2009 at 2:19 PM, David Winsemius wrote: > > On Dec 3, 2009, at 2:14 PM, Peng Cai wrote: > > Also, can I control for number of decimal places printed. Like when I use > "mean" function. By default it shows upto 7 dec. Thanks! > > > &

Re: [R] Two-way/Three-way sum.

2009-12-03 Thread Peng Cai
Also, can I control for number of decimal places printed. Like when I use "mean" function. By default it shows upto 7 dec. Thanks! On Thu, Dec 3, 2009 at 2:08 PM, Peng Cai wrote: > Thanks David for your suggestions. > > > On Thu, Dec 3, 2009 at 2:03 PM, David Winsemius w

Re: [R] Two-way/Three-way sum.

2009-12-03 Thread Peng Cai
Thanks David for your suggestions. On Thu, Dec 3, 2009 at 2:03 PM, David Winsemius wrote: > > On Dec 3, 2009, at 1:50 PM, Peng Cai wrote: > > Hi R Users, >> >> I'm wondering how can I calculate two (or three) way sum of a variable. A >> sample data is: >>

Re: [R] Two-way/Three-way sum.

2009-12-03 Thread Peng Cai
NA > , , Mar > 1996 1997 1998 > NC NA NA7 > NY NA NA 13 > > > > > > On Thu, Dec 3, 2009 at 1:50 PM, Peng Cai wrote: > >> Hi R Users, >> >> I'm wondering how can I calculate two (or three) way sum of a variable. A >> sampl

[R] Two-way/Three-way sum.

2009-12-03 Thread Peng Cai
Hi R Users, I'm wondering how can I calculate two (or three) way sum of a variable. A sample data is: State Month Year Value NC Jan 1996 1 NC Jan 1996 2 NC Feb 1997 2 NC Feb 1997 3 NC Mar 1998 3 NC Mar 1998 4 NY Jan 1996 4 NY Jan 1996 5 NY Feb 1997 5 NY Feb 1997 6 NY Mar 1998 6 NY Mar 1998 7 I'm

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

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

2009-12-02 Thread Peng Cai
estions, I'm trying: scales = list(relation="free", rot=90, y = list(at = yScale)) Thanks, Peng On Wed, Dec 2, 2009 at 6:17 PM, Peng Cai wrote: > Got it thanks, (relation="free" worked), more specifically > > scales = list(relation="free", y = list(at = ySc

Re: [R] barchart() {Lattice} -- auto.key()

2009-12-02 Thread Peng Cai
Thanks David, it worked. On Wed, Dec 2, 2009 at 7:34 PM, David Winsemius wrote: > > On Dec 2, 2009, at 6:27 PM, Peng Cai wrote: > > Hi R Users, >> >> I'm using following data/code (data is also attached) to produce a stacked >> barplot. >> >> *I

[R] barchart() {Lattice} -- auto.key()

2009-12-02 Thread Peng Cai
Hi R Users, I'm using following data/code (data is also attached) to produce a stacked barplot. *I need help with changing legend boxes, currently I'm using "rectangles=TRUE". Is it possible to get small squares instead -- may be with a small gap between colored squares.* Currently there is no ga

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 def

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

2009-12-02 Thread Peng Cai
ix(dta), horizontal=FALSE, stack=TRUE, par.settings = simpleTheme(col = 3:5), auto.key=list(space="right"), border=NA, scales = list(y = list(at = yScale)) ) Thanks, Peng On Wed, Dec 2, 2009 at 5:44 PM, Felix Andrews wrote: > 2009/12/3 Peng Cai : >

[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),

Re: [R] barchart() {Lattice} help.

2009-11-26 Thread Peng Cai
y to get the same key as you had earlier." > > and the relevant line in the code was: > > > auto.key = list(space = 'right', rectangles=TRUE, points=FALSE) > > -Peter Ehlers > > Peng Cai wrote: > >> Hello Peter and David, >> >> Thanks f

Re: [R] barchart() {Lattice} help.

2009-11-26 Thread Peng Cai
;), > border=NA, > panel=function(x,y,...){ > panel.abline(h=c(myYscale), col.line="gray") > panel.barchart(x,y,...) >}, > scales = list(y = list(at = myYscale)) > ) > Thanks, > Peng > > >

Re: [R] barchart() {Lattice} help.

2009-11-26 Thread Peng Cai
nthly Average PM2.5 Contribution at ATL", ylab="Speciated PM2.5 Contribution (µg/m3)", xlab="Month", box.ratio=2.5, scales = list(y = list(at = myYscale)), ) Thanks, Peng On Thu, Nov 26, 2009 at 7:23 PM, Peng Cai wrote: > Hi Again, > > Bef

Re: [R] barchart() {Lattice} help.

2009-11-26 Thread Peng Cai
t you just suggested can solve this purpose? Thanks, Peng On Thu, Nov 26, 2009 at 7:09 PM, Peter Ehlers wrote: > Peng Cai wrote: > >> Thanks David, I tried panel.abline(h=somevalue) -- both inside and outside >> of barchart() function but its not working. Any suggestions? >

Re: [R] barchart() {Lattice} help.

2009-11-26 Thread Peng Cai
Thanks David, I tried panel.abline(h=somevalue) -- both inside and outside of barchart() function but its not working. Any suggestions? Peng On Thu, Nov 26, 2009 at 6:42 PM, David Winsemius wrote: > > On Nov 26, 2009, at 6:12 PM, Peng Cai wrote: > > Thanks a lot Peter! One more he

Re: [R] barchart() {Lattice} help.

2009-11-26 Thread Peng Cai
Thanks a lot Peter! One more help, is there a similar function abline() for barchart(). I'm trying to add a (light gray colored) horizontal lines, one for each y-value. Peng On Thu, Nov 26, 2009 at 5:59 PM, Peter Ehlers wrote: > Peng Cai wrote: > >> Hi Peter, >> >&

Re: [R] barchart() {Lattice} help.

2009-11-26 Thread Peng Cai
the scale width (like -0.04, -0.02, 0, 0.02,...). Can I change these too? Thanks! Peng On Thu, Nov 26, 2009 at 3:18 PM, Peter Ehlers wrote: > > > Peng Cai wrote: > >> Hi R Users, >> >> I'm trying to plot a stacked barplot. Here is data: >> >> Sampl

Re: [R] barchart() {Lattice} help.

2009-11-26 Thread Peng Cai
, horizontal = FALSE, stack = TRUE, > par.settings = simpleTheme(col = 2:4), > auto.key = list(space = 'right', title = names(colnames(x))), > scales = list(y = list(at = -2:8)) ) > > Not your conventional stacked bar chart, but at least i

Re: [R] {ggplot2} Adding Mean to (grouped) Boxplot.

2009-11-26 Thread Peng Cai
them as factor with 6 levels. > Please let me know if you have any further question, > Thanks, > Peng > > DM > > On Thu, Nov 26, 2009 at 1:00 PM, Peng Cai wrote: > >> Hi R Users, >> >> I am using following R code to plot a "grouped boxplot". I

[R] {ggplot2} Adding Mean to (grouped) Boxplot.

2009-11-26 Thread Peng Cai
Hi R Users, I am using following R code to plot a "grouped boxplot". I'm hoping if I can add MEAN to these boxplots. Data is copied below and attached as text file. install.packages("ggplot2") library(ggplot2) dta<-read.table("Sample.txt",header=T) attach(dta) p <- ggplot(dta, aes(factor(month),

[R] barchart() {Lattice} help.

2009-11-26 Thread Peng Cai
Hi R Users, I'm trying to plot a stacked barplot. Here is data: Sample Col1 Col2 Col3 Row1 -2 4 -1 Row2 3 -2 4 Row3 3 5 -2 Row4 4 1 -1 I'm using following R code: library(lattice) dta<-read.table("data.txt", header=TRUE, row.names="Sample") barchart(data.matrix(dta), horizontal=FALSE,