[R] Newbie: how to get unique x unique x aggregate chart?

2006-11-15 Thread Christian Convey
I'm very new to R, so please forgive me if I just missed the answer in existing documentation... I have a data set with at least three columns, X, Y, and Z. I want to produce a chart where one axis shows all the unique values of X, and the other axis shows all the unique values of Y. Each cell

Re: [R] Newbie: how to get unique x unique x aggregate chart?

2006-11-15 Thread Chuck Cleland
Christian Convey wrote: I'm very new to R, so please forgive me if I just missed the answer in existing documentation... I have a data set with at least three columns, X, Y, and Z. I want to produce a chart where one axis shows all the unique values of X, and the other axis shows all the

Re: [R] Newbie: how to get unique x unique x aggregate chart?

2006-11-15 Thread Jeffrey Robert Spies
I'm not sure I understand the question, but you might look into the following functions: unique heatmap image Again, if I understand the question, you would create a length(unique (x)) by length(unique(y)) sized matrix, and fill it with appropriate values of z. Then pass that to heatmap or

Re: [R] Newbie: how to get unique x unique x aggregate chart?

2006-11-15 Thread Christian Convey
Thanks, let me try to clarify my question with an example. Suppose I have the following data: Gender, Major, Course-Grade F, Psy, 3.5 F, Psy, 3.1 M, Hst, 3.7 F, Hst, 3.6 M, Hst, 2.6 M, Eng, 3.9 I want to compute a table like the following: X-axis: Gender Y-axis: Major Cell(x,y) = mean

Re: [R] Newbie: how to get unique x unique x aggregate chart?

2006-11-15 Thread Marc Schwartz
On Wed, 2006-11-15 at 15:03 -0500, Christian Convey wrote: Thanks, let me try to clarify my question with an example. Suppose I have the following data: Gender, Major, Course-Grade F, Psy, 3.5 F, Psy, 3.1 M, Hst, 3.7 F, Hst, 3.6 M, Hst, 2.6 M, Eng, 3.9 I want to compute a

Re: [R] Newbie: how to get unique x unique x aggregate chart?

2006-11-15 Thread Gabor Grothendieck
Marc's solution looks a bit easier but here are a few more anyways: # 1 reshape(DF, dir = wide, timevar = Gender, idvar = Major) # 2 library(reshape) DFm - melt(DF, id = 1:2) cast(DFm, Major ~ Gender, fun = mean) On 11/15/06, Christian Convey [EMAIL PROTECTED] wrote: Thanks, let me try to

Re: [R] Newbie: how to get unique x unique x aggregate chart?

2006-11-15 Thread Christian Convey
That did it! Thanks Marc. - Christian On 11/15/06, Marc Schwartz [EMAIL PROTECTED] wrote: On Wed, 2006-11-15 at 15:03 -0500, Christian Convey wrote: Thanks, let me try to clarify my question with an example. Suppose I have the following data: Gender, Major, Course-Grade F, Psy,