spec-methods | R Documentation |
'spec'
Generic methods for objects with class 'spec'
## S3 method for class 'spec'
lines(x, y = NULL, type = "l", ...)
spec_details(x, ...)
## S3 method for class 'spec'
as.data.frame(x, ...)
## S3 method for class 'spec'
as.matrix(x, ...)
## S3 method for class 'spec'
as.list(x, ...)
x |
a |
y |
optional coordinate vector for the y-axis |
type |
character; the type of plot |
... |
optional arguments |
Objects with class 'spec'
are simply lists with spectral estimates and parameters
as.data.frame
converts the list into a 'data.frame'
with individual
columns for the frequency, PSD, and taper vectors;
all other information will be retained as a list in the attributes.
A.J. Barbour
## Not run: #REX
library(psd)
##
## Objects with class 'spec'
##
set.seed(1234)
xn <- rnorm(10)
x <- spectrum(xn, plot=FALSE)
xc <- psdcore(xn)
xdf <- as.data.frame(x)
str(xdf)
is.tapers(xdf$taper)
xdfc <- as.data.frame(xc)
str(xdfc)
is.tapers(xdfc$taper)
## End(Not run)#REX
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.