parseMetadata: Parse factors found in filenames or strings.

Description Usage Arguments Value

View source: R/data.R

Description

This function parses a vector of strings, returning a data frame of factors found in those strings. It takes a folder path (or alternatively a character vector) as input, and it returns a data frame with a row for each file in the folder (or for each item in the vector) and columns containing matched factors.

Usage

1
2
3
parseMetadata(paths, is.dir = T, variables = NULL, keys = NULL,
  recursive = T, drops = NULL, skips = NULL, pattern = NULL,
  simplify = T)

Arguments

paths

A character vector of complete file directory paths.

is.dir

Logical indicating whether path is a file directory, or just a vector of character strings to parse.

variables

Optional character vector selecting the subset of default keys titles to employ.

keys

A list of named character vectors, representing variable title and factors.

recursive

Logical indicating whether subdirectories should be searched.

drops

A character vector of path patterns that will cause that path to be dropped from results.

skips

A character vector of path patterns to ignore during matching, typically used if folder names contain factor patterns.

pattern

A character indicating a seach pattern to match in file paths. All files not containing this path will be ignored.

simplify

Logical indicating whether columns with all NA values should be removed from result.

Value

Data frame with a column for the parsed strings and for each of the factors.


matthewkling/ecoclim documentation built on May 21, 2019, 1:04 p.m.