Re: [R] Y-axis range in histograms

2010-05-31 Thread Andy Rominger
A few ideas: Make a log-scale y-axis like: hist(my.data,...,log="y") argument yaxp can help make the ticks look pretty...see ?par. Or use various functions from the package `plotirx': axis.break and gap.barplot might be helpful. For those functions, you'll probably need to get your frequencies

[R] simulate time series with various "colors" of noise

2010-05-27 Thread Andy Rominger
the error: Error in as.vector(.Call("RS_fractal_bootstrap_circulant_embedding", S, : error in evaluating the argument 'x' in selecting a method for function 'as.vector' If I am missing other useful functions for producing/estimating time series of the fractional/long-

Re: [R] All sub-summands of a vector

2010-04-02 Thread Andy Rominger
; 1 2 3 4 > >> rollapply(zoo(x), 2, sum) > > 1 2 3 > > 3 5 7 > >> rollapply(zoo(x), 3, sum) > > 2 3 > > 6 9 > >> rollapply(zoo(x), 4, sum) > > 2 > > 10 > > > > # all at once > > sapply(1:4, function(r) rollapply(zoo(x)

[R] All sub-summands of a vector

2010-04-02 Thread Andy Rominger
Hello, I'd like to take all possible sub-summands of a vector in the quickest and most efficient way possible. By "sub-summands" I mean for each sub-vector, take its sum. Which is to say: if I had the vector x<-1:4 I'd want the "sum" of x[1], x[2], etc. And then the sum of x[1:2], x[2:3], etc