Hello,
I'm new to R.
In Sapa package there's an example for function SDF like

data <- as.numeric(sunspots)
methods <- c("direct","wosa","multitaper","lag window")
S <- lapply(methods, function(x, data) SDF(data, method=x), data)
x <- attr(S[[1]], "frequency")[-1]
y <- lapply(S,function(x) decibel(as.vector(x)[-1]))

which works fine, but if I use some taper, e.g.

S=SDF(data, method="lag window",
taper.=taper(type="hamming",n.sample=length(data)))

that produces negative values, the decibel() function expectantly throws
error.

f=attr(vysl,"frequency")[-1]
s=decibel(as.vector(S)[-1])

Error in decibel(as.vector(vysl)[-1]) : cannot convert negative values to
decibels

Is it possible to use some other function than decibel, or how else can
estimate spec.density with tapers from this package?
Thank you very much.

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to