View source: R/relabel_colms.R
relabel_colms | R Documentation |
relabel_colms
relabels columns to match the selection table format (as in the R package warbleR)
relabel_colms(X, extra.cols.name = NULL, extra.cols.new.name = NULL,
khz.to.hz = FALSE, hz.to.khz = FALSE, waveform = FALSE)
X |
Data frame imported from Raven. |
extra.cols.name |
Character vector with the names of additional columns to be relabeled. Default is |
extra.cols.new.name |
Character vector with the new names for the additional columns to be relabeled.
Default is |
khz.to.hz |
Logical. Controls if frequency variables ('top.freq' and 'bottom.freq') should be converted from kHz
(the unit used by other bioacoustic analysis R packages like warbleR) to Hz (the unit used by Raven).
Default is |
hz.to.khz |
Logical. Controls if frequency variables ('top.freq' and 'bottom.freq') should be converted from Hz
(the unit used by other bioacoustic analysis R packages like Raven) to kHz (the unit used by warbleR).
Default is |
waveform |
Logical to control if 'waveform' related data should be included (this data is typically duplicated in 'spectrogram' data). Default is |
This function relabels columns to match the selection table format to match then ones used by other bioacoustic analysis R packages like warbleR.
The function returns the input data frame with new column names for time and frequency 'coordinates' and sound files and selections.
Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)
imp_raven
; exp_raven
# Load data
data(selection_files)
#save 'Raven' selection tables in the temporary directory
writeLines(selection_files[[5]], con = file.path(tempdir(), names(selection_files)[5]))
#'# import data to R
rvn.dat <- imp_raven(all.data = TRUE, path = tempdir())
names(rvn.dat)
# Select data for a single sound file
rvn.dat2 <- relabel_colms(rvn.dat)
names(rvn.dat2)
# plus 1 additional column
rvn.dat2 <- relabel_colms(rvn.dat, extra.cols.name = "selec.file", "Raven selection file")
names(rvn.dat2)
# plus 2 additional column
rvn.dat2 <- relabel_colms(rvn.dat, extra.cols.name = c("selec.file", "View"),
c("Raven selection file", "Raven view"))
names(rvn.dat2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.