Description Usage Arguments Author(s) See Also Examples
Plotting acoustic templates and template scores
1 2 3 4 5 6 7 8 9 10 11 12 | ## S4 method for signature 'TemplateList,ANY'
plot(x, which.one = names(x@templates), click = FALSE,
ask = if(length(which.one)>1) TRUE else FALSE, spec.col = gray.3(), on.col = '#FFA50075',
off.col = '#0000FF75', pt.col = '#FFA50075', line.col = 'black')
## S4 method for signature 'detectionList,ANY'
plot(x, flim = c(0, 12), scorelim,
which.one = names(x@templates), box = TRUE, spec.col = gray.2(), t.each = 30,
hit.marker = 'lines',
color = c('red', 'blue', 'green', 'orange', 'purple', 'pink', 'darkgreen', 'turquoise',
'royalblue', 'orchid4', 'brown', 'salmon2'), legend = TRUE, all.peaks = FALSE,
ask = if(dev.list() == 2) TRUE else FALSE)
|
x |
A template list ( |
which.one |
Names of templates to be plotted. |
click |
Set to |
ask |
Set to |
spec.col |
Color ramp for spectrogram. |
on.col |
Color for “on” points (binary templates only). |
off.col |
Color for “off” points (binary templates only). |
pt.col |
Color for template points (correlation templates only). |
line.col |
Color for lines if |
flim |
Frequency limits for plot. |
scorelim |
Score limits for plot. |
box |
If |
t.each |
Duration shown in each individual plot (s). |
hit.marker |
Type of marker used to show detections in score plot. Can be |
color |
Colors used for individual templates. |
legend |
Show legend? |
all.peaks |
Indicate location of all peaks? |
Sasha D. Hafner
makeCorTemplate
,
makeBinTemplate
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | ## Not run:
# Not run because of the time required (maybe 5-10 seconds)
# Also some plot calls require user input by default
# Load data
data(btnw)
data(survey)
# Write Wave objects to file (temporary directory used here)
btnw.fp <- file.path(tempdir(), "btnw.wav")
oven.fp <- file.path(tempdir(), "oven.wav")
survey.fp <- file.path(tempdir(), "survey2010-12-31_120000_EST.wav")
writeWave(btnw, btnw.fp)
writeWave(survey, survey.fp)
# Create a template list
ctemp1 <- makeCorTemplate(btnw.fp, name = "w1")
ctemp2 <- makeCorTemplate(btnw.fp, t.lim = c(0.5, 2.5), frq.lim = c(1, 10), dens = 0.1, name = "w2")
ctemps <- combineCorTemplates(ctemp1, ctemp2)
# Then it can be plotted like this
plot(ctemps)
# Next call is not useful for template w1 but good for w2:
plot(ctemps, pt.col = "red")
# Can plot just one template
plot(ctemps, which.one = 2, pt.col = "red")
plot(ctemps, which.one = "w2", pt.col = "red")
# And to check values
plot(ctemps, which.one = 1, click = TRUE)
# To plot detections, let's create some
cscores <- corMatch(survey.fp, ctemps)
cdetects <- findPeaks(cscores)
# And to plot them:
plot(cdetects)
# Clean up (only because these files were created in these examples)
file.remove(btnw.fp)
file.remove(survey.fp)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.