[R] plotting spectrum of time series etc
Ben Bolker
ben at zoo.ufl.edu
Tue Feb 1 16:18:22 CET 2000
library(ts)
x <- runif(256)
spectrum(x)
works for me, as do the examples in the help file.
What is "seriesa"? Can you give us a slightly more complete snippet of
code that produces the problem? spectrum() might not work when applied to
data frames -- have you tried spectrum(as.vector(seriesa))?
On Tue, 1 Feb 2000 zj at expert.cc.purdue.edu wrote:
> Hi, everyone, I tried to use "spectrum()" or "spec.pgram()" to get a
> periodogram of a time series but they didn't work.
> Even the examples given in the help file didn't work (all with the same
> error message, below). And the 'ts'ibrary was
> loaded with "library(ts)" or "library("ts"). I also tried
> library(tseries) but got the same problem. Could anyone please
> give me some help with this?
>
> > spectrum(seriesa)
> Error in plot.spec(spg.out, ...) : binary operator applied to invalid
> types.
>
--
Ben Bolker bolker at zoo.ufl.edu
Zoology Department, University of Florida http://www.zoo.ufl.edu/bolker
318 Carr Hall/Box 118525 tel: (352) 392-5697
Gainesville, FL 32611-8525 fax: (352) 392-3704
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list