Learn R Programming

broom (version 0.3.4)

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 class '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
spc <- spectrum(lh)
tidy(spc)

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

Run the code above in your browser using DataLab