Skip to content
Prev 2525 / 15274 Next

apply.fromstart() warnings

Hi,


Did you see where the answers are wrong? I tried the following, and it appears correct  (except for the warnings):
Column.1 Column.2
1970-01-02       NA       NA
1970-01-03       NA       NA
1970-01-04       NA       NA
1970-01-05       NA       NA
1970-01-06       NA       NA
1970-01-07       NA       NA
1970-01-08       NA       NA
1970-01-09       NA       NA
1970-01-10       NA       NA
1970-01-11      5.5      5.5
1970-01-12      6.0      6.0
1970-01-13      6.5      6.5
1970-01-14      7.0      7.0
1970-01-15      7.5      7.5
1970-01-16      8.0      8.0
1970-01-17      8.5      8.5
1970-01-18      9.0      9.0
1970-01-19      9.5      9.5
1970-01-20     10.0     10.0
1970-01-21     10.5     10.5
There were 22 warnings (use warnings() to see them)

That's correct, no? The mean of the first 10 entries go into the 10th row, the mean of the first 11 entries go into the 11th row, etc.

Funnily enough, there are no warnings if I run the function on a vector, say:

apply.fromstart(1:20, gap=10, FUN=mean)

Cheers,
Murali
_________________________________________________________________
Give to a good cause with every e-mail. Join the i?m Initiative from Microsoft.