compare.methods
create graphs to visually assess performance of acoustic distance measurementscompare.methods(X = NULL, flim = c(0, 22), bp = c(0, 22), mar = 0.1, wl = 512, ovlp = 90,
res = 150, n = 10, length.out = 30, methods = c("XCORR",
"dfDTW", "ffDTW", "SP"),it = "jpeg", parallel = 1)
spectro
. Default is c(0, 22).spectro
. Default is 90.xcorr
), dynamic time warping on dominant frequency time series (dfDTW, from
warbleR
from github to run parallel.
Note that creating imagesxcorr
), dynamic time warping on dominant frequency time
series (dfDTW, from dtw
applied on dfts
output), dynamic time
warping on dominant frequency time series (ffDTW, from dtw
applied on
ffts
output), spectral parameters (SP, from specan
). The graph also
contains 2 scatterplots (1 for each method) of the acoustic space of all signals in the
input data frame 'X'. The compared selections are randomly picked up from the pool of
selections in the input data frame. The argument 'n' defines the number of comparison (e
.i. graphs) to be produced. The acoustic pairwise distance between signals is shown next
to the arrows linking them. The font color of a distance value correspond to the font
color of the method that generetad it, as shown in the scatterplots. Distances are
standardize, being 0 the distance of a signal to itself and 1 the farthest pairwise
distance in the pool of signals. Principal Component Analysis (princomp
)
is applied to calculate distances when using spectral parameters (SP). In that case the first 2 PC's are used. Classical
Multidimensional Scalling (also knwon as Principal Coordinates Analysis,
(cmdscale
)) is used for all other methods. Note that SP can only be used with at least 22 selections (number of rows in input data frame) as PCA only works with more units than variables. The graphs are return as image files in the
working directory. The file name contains the methods being compared and the
rownumber of the selections. This function uses internally a modified version
of the spectro
function from seewave package to create spectrograms.# First create empty folder
setwd(tempdir())
data(list = c("Phae.long1", "Phae.long2", "Phae.long3", "Phae.long4", "manualoc.df"))
writeWave(Phae.long1,"Phae.long1.wav")
writeWave(Phae.long2,"Phae.long2.wav")
writeWave(Phae.long3,"Phae.long3.wav")
writeWave(Phae.long4,"Phae.long4.wav")
compare.methods(X = manualoc.df, flim = c(0, 10), bp = c(0, 10), mar = 0.1, wl = 512,
ovlp = 90, res = 200, n = 10, length.out = 30,
methods = c("XCORR", "dfDTW"), parallel = 1, it = "tiff")
#check this folder!!
getwd()
Run the code above in your browser using DataLab