Names of x
are preserved; if x
is not named, names are
assigned from the values of x
itself, and so are empty names
in partially-named x
. Every directory in x
is replaced
with its contents (as returned by list.files
),
their names obtained by concatenating the name of the directory
element with their paths inside the directory (with
.Platform$file.sep
as a separator). For example,
when importing x = c('foo' = 'bar')
with directory bar
containing baz.txt
, resulting name would be foo/baz.txt
.
When importing many files from the same directory, the
simplify.names
option is useful to avoid duplication in resulting
names. For example,
feemlist('.', simplify.names = FALSE)
results in a list with
all names starting with ./
, while
feemlist('foo/bar/baz', simplify.names = TRUE)
(default) would
shave off all three common path components and the separators.
Mixing files and directories in x
will most likely not preserve
the order of the elements.
Note: Please don't rely on the name generation behaving exactly
as specified as it may be changed in the future versions.
When importing custom file formats, the format
function should
typically take the following form:
function(filename, ...) {
# read data from filename
# take additional arguments passed from feemlist(...) if needed
return(feem(data))
}