[R] Newbie: how to get unique x unique x aggregate chart?
Jeffrey Robert Spies
jspies at nd.edu
Wed Nov 15 16:08:54 CET 2006
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 image.
Hope that helps--feel free to tell me if I've answered the wrong
question,
Jeff.
On Nov 15, 2006, at 8:30 AM, 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 unique values of Y. Each cell
> within the
> chart should contain the result of applying an aggregate function
> (such as
> mean(), for example) to Z value of those rows that are associated
> with that
> cell (via their X and Y values).
>
> Can someone recommend a good way to do this?
>
> Thanks very much,
> Christian
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at stat.math.ethz.ch 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.
More information about the R-help
mailing list