Learn R Programming

warbleR (version 1.1.4)

coor.graph: Coordinated singing graphs

Description

coor.graph creates graphs of coordinated singing and highlights the signals that overlap in time. The signals are represented by polygons of different colors.

Usage

coor.graph(X, only.coor = FALSE, ovlp = TRUE, xl = 1, res= 80, it = "jpeg", img = TRUE, tlim = NULL)

Arguments

X
Data frame containing columns for singing event (sing.event), individual (indiv), and start and end time of signal (start and end).
only.coor
Logical. If TRUE only the segment in which both individuals are singing is included (solo singing is removed). Default is FALSE.
ovlp
Logical. If TRUE the vocalizations that overlap in time are highlighted. Default is TRUE.
xl
Numeric vector of length 1, a constant by which to scale spectrogram width. Default is 1.
res
Numeric argument of length 1. Controls image resolution. Default is 80.
it
A character vector of length 1 giving the image type to be used. Currently only "tiff" and "jpeg" are admitted. Default is "jpeg".
img
Logical argument. If FALSE, image files are not produced. Default is TRUE. Note that images are return
tlim
Numeric vector of length 2 indicating the start and end time of the coordinated singing events to be displayed in the graphs.

Value

The function returns a list of graphs, one for each singing event in the input data frame. The graphs can be plotted by simply calling the list. If 'img' is TRUE then the graphs are also saved in the working directory as files.

Details

This function provides visualization for coordination of acoustic signals. Signals are shown as polygon across a time axis. It also shows which signals overlap, the amount of overlap, and highlights the individual responsible for the overlap using a color code. The width of the polygons depicting the time of overlap.

Examples

Run this code
## Not run: 
# 
# # First set temporary folder
# setwd(tempdir())
# 
# # load simulate singing events  (see data documentation)
# , data(sim.coor.sing)
# 
# # make coor.graphs in tiff format
# coor.graph(X = sim.coor.sing, ovlp = TRUE, only.coor = FALSE, xl =2, res =80, 
# it = "tiff", img = TRUE)
# 
# 
# #' # make coor.graphs in graphic device format
# cgs <- coor.graph(X = sim.coor.sing, ovlp = TRUE, only.coor = FALSE, img = FALSE)
# 
# cgs
# ## End(Not run)

Run the code above in your browser using DataLab