updateFiles: Update Location of Files in an AcousticStudy

View source: R/updateFiles.R

updateFilesR Documentation

Update Location of Files in an AcousticStudy

Description

Updates the stored locations of binary, database, and/or recording files in the files slots of an AcousticStudy and all AcousticEvent objects within. Runs interactively to prompt users to select folders if missing files are found. Typically used after changing computers, or if original data was on an external hard drive. If any missing files are not able to be located, they will be kept in the files slot so that this function can be run again

Usage

updateFiles(
  x,
  bin = NULL,
  db = NULL,
  recording = NULL,
  verbose = TRUE,
  check = TRUE
)

Arguments

x

an AcousticStudy or AcousticEvent object

bin

folder containing updated binary file locations. If NULL (default), user will be prompted to select a folder. If NA, binary files will be skipped.

db

single file or folder containing updated database file locations. NULL (default), user will be prompted to select a folder. If NA, database files will be skipped.

recording

folder containing updated recording file locations. If NULL (default), user will be prompted to select a folder. If NA, recording files will be skipped.

verbose

logical flag to print messages about success of replacement

check

logical flag to do extra checking. You do not need to set this parameter, used internally for speed purposes so certain checks are not repeated

Value

the same AcousticStudy and AcousticEvent object as x with updated file locations

Author(s)

Taiki Sakai taiki.sakai@noaa.gov

Examples


data(exStudy)
# files in exStudy will have paths local to package creator's computer
files(exStudy)$db
file.exists(files(exStudy)$db)
files(exStudy)$binaries
file.exists(files(exStudy)$binaries)
# folder with example DB
db <- system.file('extdata', package='PAMpal')
# folder with example binaries
bin <- system.file('extdata', 'Binaries', package='PAMpal')
exStudy <- updateFiles(exStudy, db=db, bin=bin)
files(exStudy)$db
file.exists(files(exStudy)$db)
files(exStudy)$binaries
file.exists(files(exStudy)$binaries)


PAMpal documentation built on Sept. 11, 2024, 6:31 p.m.