On Wed, Jul 8, 2009 at 9:40 AM, Henrique Dallazuanna <wwwhsd@gmail.com>wrote:

> Its because '[[' accept only element, so you need use '[':
>
> q[crossRsorted[,1]]
>
>
Henrique,

I figured out what q[crossRsorted[,1]] does - it produces q[i] for all i in
crossRsorted[,1]. Ok. Since a given index 'k' of q[[k]] can occur in
multiple rows in crossRsorted[,1], this is not what I want.

Meanwhile, I was able to express what I do want like so:

crossRsorted[Filter(function (idx) mean(q[[idx]], na.rm = TRUE),
unique(crossRsorted[,1])), ]

but, I'm afraid, that's not really "R style."  Or is it?  But perhaps the
only way?

I think I'm starting to see the allure of R: every indexing task ends up a
challenging puzzle.
Which prevents Alzheimer's [1].

 - Godmar

[1] http://www.timesonline.co.uk/tol/life_and_style/article508785.ece

	[[alternative HTML version deleted]]


