Skip to content
Prev 201848 / 398503 Next

How to compute Rolling analysis of Standard Deviation using ZOO package?

We will need a minimal reproducible example (as per last line on every
message to r-help) to answer as trying it with made up data seems to
work for me.   If c is very long try cutting it down to the smallest
you can get it to and still produce the error, e.g.

cc <- c[1:10]
rollapply(cc, ...)

and then post the output of dput(cc)

Here is an example:
1        2        3        4        5        6
      NA       NA       NA       NA       NA       NA
       7        8        9       10       11       12
      NA       NA       NA 3.027650 3.027650 3.027650
      13       14       15       16       17       18
3.027650 3.027650 3.027650 3.027650 3.027650 3.027650
      19       20       21       22       23       24
3.027650 3.027650 3.027650 3.027650 3.027650 3.027650
      25       26       27       28       29       30
3.027650 3.027650 3.027650 3.027650 3.027650 3.027650
      31       32       33       34       35       36
3.027650 3.027650 3.027650 3.027650 3.027650 3.027650
      37       38       39       40       41       42
3.027650 3.027650 3.027650 3.027650 3.027650 3.027650
      43       44       45       46       47       48
3.027650 3.027650 3.027650 3.027650 3.027650 3.027650
      49       50       51       52       53       54
3.027650 3.027650 3.027650 3.027650 3.027650 3.027650
      55       56       57       58       59       60
3.027650 3.027650 3.027650 3.027650 3.027650 3.027650
      61       62       63       64       65       66
3.027650 3.027650 3.027650 3.027650 3.027650 3.027650
      67       68       69       70       71       72
3.027650 3.027650 3.027650 3.027650 3.027650 3.027650
      73       74       75       76       77       78
3.027650 3.027650 3.027650 3.027650 3.027650 3.027650
      79       80       81       82       83       84
3.027650 3.027650 3.027650 3.027650 3.027650 3.027650
      85       86       87       88       89       90
3.027650 3.027650 3.027650 3.027650 3.027650 3.027650
      91       92       93       94       95       96
3.027650 3.027650 3.027650 3.027650 3.027650 3.027650
      97       98       99      100
3.027650 3.027650 3.027650 3.027650
[1] "R version 2.10.0 Patched (2009-11-21 r50532)"
[1] "1.6-2"
On Fri, Nov 27, 2009 at 2:19 AM, Saji Ren <saji.ren at gmail.com> wrote: