R traverse file

First, the purpose of the function

The folder name the file to the list, it can be used to batch import files

Second, the function parameters

list.files (path = ".", pattern = NULL, all.files = FALSE,
full.names = FALSE, FALSE = recursive This,
ignore.case = FALSE, include.dirs = FALSE, FALSE = NO ..)
III. common arguments to explain

1. path: Enter the folder path

2. pattern: match the file name, select the files they need (optional, default is all file names, including subfolders, but does not include the file subfolders), such as pattern = "* .XPT $", represents to output file name .XPT the end, if there is no $ symbol, the output file name contains .XPT

3. all.files: whether to return all files, including hidden files, but does not include subfolders, and whether the default

4. full.names: whether to return path + file name, whether the default, if whether the file name is returned

5. recursive: whether subfolders are also listed

6. ignore.case: whether the matching file names to ignore case by default No, that does not ignore case

Fourth, examples

 

 



Guess you like

Origin www.cnblogs.com/nkwy2012/p/12602838.html