broom (version 0.4.2)

tidy.spec: tidy a spec objet

Description

Given a "spec" object, which shows a spectrum across a range of frequencies, returns a tidy data frame with two columns: "freq" and "spec"

Usage

# S3 method for spec
tidy(x, ...)

Arguments

x

an object of class "spec"

...

extra arguments (not used)

Value

a data frame with "freq" and "spec" columns

Examples

Run this code
# NOT RUN {
spc <- spectrum(lh)
tidy(spc)

library(ggplot2)
ggplot(tidy(spc), aes(freq, spec)) + geom_line()

# }

Run the code above in your browser using DataCamp Workspace