sort_colms
sorts selection table columns in a more intuitive order.
Arguments
- X
Data frame containing columns for sound file (sound.files), selection (selec), start and end time of signals ('start' and 'end') and low and high frequency ('bottom.freq' and 'top.freq', optional). See the example data 'lbh_selec_table'.
Value
The same data as in the input data frame but with the most relevant information for acoustic analysis located in the first columns.
Details
The function returns the data from the input data frame with the most relevant information for acoustic analysis located in the first columns. The priority order for column names is: "sound.files", "channel", "selec", "start", "end", "top.freq", and "bottom.freq".
Author
Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)
Examples
library(warbleR)
data("selec.table")
# mess column order
selec.table <- selec.table[, sample(seq_len(ncol(selec.table)))]
# check names
names(selec.table)
#> [1] "selec" "channel" "bottom.freq" "top.freq" "sel.comment"
#> [6] "sound.files" "end" "rec.comment" "start"
selec.table <- sort_colms(X = selec.table)
# check names again
names(selec.table)
#> [1] "sound.files" "channel" "selec" "start" "end"
#> [6] "top.freq" "bottom.freq" "sel.comment" "rec.comment"