A container is a location that holds several tables: a directory, a zip,
a workbook read sheet by sheet. A container entry produces a bare named
list of data frames – no class. Whatever the consuming block wants the
list to become (a dm, via dm::new_dm()) is its own wrap, made outside
this package.
Arguments
- opens
Character vector of file extensions (without dots), or the string
"directory". Directories are not a special case in the lookup, only a key that is not an extension.- list_tables
function(path)returning the table names available atpath, cheaply: discovery must not read table data where the format allows it (a zip's central directory, a workbook's sheet index). Formats whose only index is the data itself (an.rds) may read; they are local files read once at configure time. Return a character vector, or a data frame with anamecolumn and an optionallabelcolumn carrying a short display string per table ("CSV 2.1 MB").- read
function(path, tables, ...)returning one unevaluated expression that evaluates to a named list of data frames, restricted totables(NULLmeans all). The expression may compose member reads viaformat_read_expr()at build time, and may only call reader packages....carries uniform member options: an entry that holds files of other formats should forward it into each member'sformat_read_expr()call, where the member's entry picks the parameters it understands (sosep = ";"reaches every csv in a folder and everything else ignores it).- options
What the container accepts through
read's...: a named list of format_opt specs, or afunction(path)returning one, since a container that holds files of other formats cannot know its options until it is pointed somewhere (member_options()over its members is the usual answer).NULLfor a container with nothing to tune.