Learn R Programming

psd (version 0.4-1)

spec-methods: Generic methods for objects with class 'spec'.

Description

Generic methods for objects with class 'spec'.

Usage

## S3 method for class 'spec':
as.data.frame(x, ...)

## S3 method for class 'spec': data.frame(x, ...)

Arguments

x
spec object
...
optional arguments

Details

Objects with class 'spec' are simply list objects. 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 an attribute. data.frame is an alias.

Examples

Run this code
#RDEX#\dontrun{
require(psd)
##
## Objects with class 'spec'
##
set.seed(1234)
#
x <- spectrum(xn<-rnorm(10), plot=FALSE)
xdf <-as.data.frame(x)
str(xdf)
is.tapers(xdf$taper)
#
# tapers class is retained
#
x <- psdcore(xn)
xdf <- as.data.frame(x)
str(xdf)
is.tapers(xdf$taper)
#RDEX#}

Run the code above in your browser using DataLab