[R] Odp: Apply function
petr.pikal at precheza.cz
Tue Nov 11 11:10:28 CET 2008
r-help-bounces at r-project.org napsal dne 11.11.2008 06:59:55:
> Hi all
> I am manipulating a datafram which has 3 variables.Such as:
> 1 2 3
> 4 5 6
> 200 210 300
> I also has a row index: index=c(100,200,250..300)
> I want to find the sums of first 100 rows, then the sum from row 101 to
> 200, then row 201 to row 250... the each end row is indicated by the
A little bit vague question, hence vague answer.
make a factor which has 3 values repeated 100 times (rep) and then use
almost any of aggregation function ( e.g. tapply, by, aggregate) with sum
> Can I use the apply function to do that? or any other way?
> View this message in context: http://www.nabble.com/Apply-function-
> Sent from the R help mailing list archive at Nabble.com.
> R-help at r-project.org mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help