move_images | R Documentation |
move_images
moves/copies image files created by warbleR
between
directories (folders).
move_images(
from = NULL,
to = NULL,
it = "all",
cut = TRUE,
overwrite = FALSE,
create.folder = TRUE,
folder.name = "image_files",
parallel = 1,
pb = TRUE
)
from |
Directory path where image files to be copied are found.
If |
to |
Directory path where image files will be copied to. |
it |
A character vector of length 1 giving the image type to be used. "all", "tiff", "jpeg" and "pdf" are admitted ("all" includes all the rest). Default is "all". |
cut |
Logical. Determines if files are removed from the original location after
being copied (cut) or not (just copied). Default is |
overwrite |
Logical. Determines if files that already exist in the destination directory
should be overwritten. Default is |
create.folder |
Logical. Determines if files are moved to a new folder (which is named with the
"folder.name" argument). Ignored if 'to' is provided. Default is |
folder.name |
Character string with the name of the new folder where the files will be
copied to. Ignored if 'to' is provided. Default is |
parallel |
Numeric. Controls whether parallel computing is applied. It specifies the number of cores to be used. Default is 1 (i.e. no parallel computing). |
pb |
Logical argument to control progress bar. Default is |
This function aims to simplify the manipulation of the image files generated by many
of the warbleR
function. It copies/cuts files between directories.
Image files moved into user-defined folders.
Marcelo Araya-Salas (marcelo.araya@ucr.ac.cr)
Araya-Salas, M., & Smith-Vidaurre, G. (2017). warbleR: An R package to streamline analysis of animal acoustic signals. Methods in Ecology and Evolution, 8(2), 184-191.
filter_sels
Other data manipulation:
open_wd()
,
split_sound_files()
{
# load data
data(list = c("Phae.long1", "Phae.long2", "Phae.long3", "Phae.long4", "lbh_selec_table"))
writeWave(Phae.long1, file.path(tempdir(), "Phae.long1.wav"))
writeWave(Phae.long2, file.path(tempdir(), "Phae.long2.wav"))
# create spectrograms
spectrograms(lbh_selec_table[1:5, ], path = tempdir(), pb = FALSE)
# create folder to move image files
dir.create(file.path(tempdir(), "imgs"))
# copy files
move_images(cut = FALSE, from = tempdir(), to = file.path(tempdir(), "imgs"))
# cut files
move_images(
cut = TRUE, from = tempdir(),
to = file.path(tempdir(), "imgs"), overwrite = TRUE
)
# Check this folder
file.path(tempdir(), "imgs")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.