multiread | R Documentation |
Read in a collection of text files.
multiread( path = ".", extension = "txt", recursive = FALSE, ignore.case = FALSE, prune.empty = TRUE, pathnames = TRUE )
path |
The base file path to search. |
extension |
An extension or the "*" wildcard (for everything). For example,
to read in files ending |
recursive |
Logical; should the search include all subdirectories? |
ignore.case |
Logical; should case be ignored in the extension? For example, if
|
prune.empty |
Logical; should empty files be removed from the returned list? |
pathnames |
Logical; should the full path be included in the names of the returned list. |
The extension
argument is not a general regular
expression pattern, but a simplified pattern. For example,
the pattern *.txt
is really equivalent to
*[.]txt$
as a regular expression. If you need more
complicated patterns, you should directly use the dir()
function.
A named list of strings, where the names are the file names.
## Not run: path = system.file(package="ngram") ### Read all files in the base path multiread(path, extension="*") ### Read all .r/.R files recursively (warning: lots of text) multiread(path, extension="r", recursive=TRUE, ignore.case=TRUE) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.