Learn R Programming

phonTools (version 0.2-2.2)

snip: Snip/Zoom

Description

Select a subsection of a sound or spectrogram object.

Usage

snip  (object, show = TRUE)

Value

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

Arguments

object

A 'sound' or 'spectrogram' object to be truncated.

show

If TRUE, the selected subsection is displayed, resulting in zoom functionality.

Author

Santiago Barreda <sbarreda@ucdavis.edu>

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 the output is assigned to a variable, a new object is 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