relabel_colms {Rraven} | R Documentation |
Relabel columns to match the selection table format
Description
relabel_colms
relabels columns to match the selection table format (as in the R package warbleR
)
Usage
relabel_colms(X, extra.cols.name = NULL, extra.cols.new.name = NULL,
khz.to.hz = FALSE, hz.to.khz = FALSE, waveform = FALSE)
Arguments
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 |
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 |
waveform |
Logical to control if 'waveform' related data should be included (this data is typically duplicated in 'spectrogram' data). Default is |
Details
This function relabels columns to match the selection table format to match then ones used by other bioacoustic analysis R packages like warbleR
.
Value
The function returns the input data frame with new column names for time and frequency 'coordinates' and sound files and selections.
Author(s)
Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)
See Also
Examples
# 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)