templatePath: Song clip path of Templates

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/templatePath.R

Description

Functions to check or change the song clip path of templates within an acoustic template list.

Usage

1
2
  templatePath(object)
  templatePath(object) <- value

Arguments

object

An acoustic template list, i.e., a corTemplateList or binTemplateList object.

value

A character vector of paths. May be named.

Details

This function works in the same way as the function names. No check is performed to ensure that the specified path is valid.

Value

For filePath, NULL or a character vector of the same length as object. For filePath <- , the updated template list, i.e., the original template list with only the clip.path values changed.

Author(s)

Sasha D. Hafner

See Also

makeCorTemplate, makeBinTemplate, templateComment, templateCutoff, templateNames,

Examples

 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
# Load data
data(btnw)
data(oven)

# Write Wave objects to file (temporary directory used here)
btnw.fp <- file.path(tempdir(), "btnw.wav")
oven.fp <- file.path(tempdir(), "oven.wav")
writeWave(btnw, btnw.fp)
writeWave(oven, oven.fp)

# Create four correlation templates
wct1 <- makeCorTemplate(btnw.fp, name = "w1")
wct2 <- makeCorTemplate(btnw.fp, t.lim = c(1.5, 2.1), frq.lim = c(4.2, 5.6), name = "w2")
oct1 <- makeCorTemplate(oven.fp, t.lim = c(1, 4), frq.lim = c(1, 11), name = "o1")
oct2 <- makeCorTemplate(oven.fp, t.lim = c(1, 4), frq.lim = c(1, 11), dens = 0.1, name = "o2")

# Combine all of them
ctemps <- combineCorTemplates(wct1, wct2, oct1, oct2)
ctemps

# To check paths
templatePath(ctemps)

# Change the first two
templatePath(ctemps)[1:2] <- c("~/templates/btnw.wav", "~/templates/btnw.wav")

# Clean up (only because these files were created in these examples)
file.remove(btnw.fp)
file.remove(oven.fp)

monitoR documentation built on May 1, 2019, 6:28 p.m.