Learn R Programming

phonTools (version 0.2-2.0)

snip: Snip/Zoom

Description

Select a subsection of a sound or spectrogram object.

Usage

snip  (object, show = TRUE)

Arguments

object
A 'sound' or 'spectrogram' object to be truncated.
show
If TRUE, the selected subsection is displayed, resulting in zoom functionality.

Value

  • A 'sound' or 'spectrogram' object which interacts with several functions included in this package.

Details

The input object is plotted and the user must click on two points on the plot. If show = TRUE, this function allows the user to zoom in on a subsection of the object. If output = TRUE, a new object is then created and returned that contains only the data in between the two designated points.

Examples

Run this code
data (sound)
## the example below is commented because examples cannot 
## require user interaction. simply uncomment the lines below
## and select two points on the plot. 
# clipped = snipsound (sound)
# spectrogram (clipped)
# spectralslice (clipped)

Run the code above in your browser using DataLab