View source: R/clean_metadata.R
clean_metadata | R Documentation |
Using regular expressions, metadata is extracted from file names and directory structure, checked and cleaned.
clean_metadata(
project_dir = NULL,
project_files = NULL,
file_type = "wav",
subset = NULL,
subset_type = "keep",
pattern_site_id = create_pattern_site_id(),
pattern_aru_id = create_pattern_aru_id(),
pattern_date = create_pattern_date(),
pattern_time = create_pattern_time(),
pattern_dt_sep = create_pattern_dt_sep(),
pattern_tz_offset = create_pattern_tz_offset(),
order_date = "ymd",
quiet = FALSE
)
project_dir |
Character. Directory where project files are stored. File paths will be used to extract information and must actually exist. |
project_files |
Character. Vector of project file paths. These paths can
be absolute or relative to the working directory, and don't actually need
to point to existing files unless you plan to use |
file_type |
Character. Type of file (extension) to summarize. Default wav. |
subset |
Character. Text pattern to mark a subset of files/directories
to either |
subset_type |
Character. Either |
pattern_site_id |
Character. Regular expression to extract site ids. See
|
pattern_aru_id |
Character. Regular expression to extract ARU ids. See
|
pattern_date |
Character. Regular expression to extract dates. See
|
pattern_time |
Character. Regular expression to extract times. See
|
pattern_dt_sep |
Character. Regular expression to mark separators
between dates and times. See |
pattern_tz_offset |
Character. Regular expression to extract time zone
offsets from file names. See. |
order_date |
Character. Order that the date appears in. "ymd" (default), "mdy", or "dmy". Can be a vector of multiple patterns to match. |
quiet |
Logical. Whether to suppress progress messages and other non-essential updates. |
Note that times are extracted by first combining the date, date/time separator and the time patterns. This means that if there is a problem with this combination, dates might be extracted but date/times will not. This mismatch can be used to determine which part of a pattern needs to be tweaked.
See vignette("customizing", package = "ARUtools")
for details on
customizing clean_metadata()
for your project.
Data frame with extracted metadata
clean_metadata(project_files = example_files)
clean_metadata(project_files = example_files, subset = "P02")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.