#R# R读取文件夹及文件

## -----------------------------------------------读取文件夹----------------------------------------------------------------## 

List the Files in a Directory/Folder


Description


These functions produce a character vector of the names of files or directories in the named directory.


Usage


list.files(path = ".", pattern = NULL, all.files = FALSE,
           full.names = FALSE, recursive = FALSE,
           ignore.case = FALSE, include.dirs = FALSE, no.. = FALSE)


       dir(path = ".", pattern = NULL, all.files = FALSE,
           full.names = FALSE, recursive = FALSE,
           ignore.case = FALSE, include.dirs = FALSE, no.. = FALSE)


list.dirs(path = ".", full.names = TRUE, recursive = TRUE)
Arguments


path
a character vector of full path names; the default corresponds to the working directory, getwd(). Tilde expansion (see path.expand) is performed. Missing values will be ignored.


pattern
an optional regular expression. Only file names which match the regular expression will be returned.


all.files
a logical value. If FALSE, only the names of visible files are returned. If TRUE, all file names will be returned.


full.names
a logical value. If TRUE, the directory path is prepended to the file names to give a relative file path. If FALSE, the file names (rather than paths) are returned.


recursive
logical. Should the listing recurse into directories?


ignore.case
logical. Should pattern-matching be case-insensitive?


include.dirs
logical. Should subdirectory names be included in recursive listings? (They always are in non-recursive ones).


no..
logical. Should both "." and ".." be excluded also from non-recursive listings?


## -----------------------------------------------读取文件--------------------------------------------------------------------## 

File Manipulation


Description


These functions provide a low-level interface to the computer's file system.


Usage


file.create(..., showWarnings = TRUE)
file.exists(...)
file.remove(...)
file.rename(from, to)
file.append(file1, file2)
file.copy(from, to, overwrite = recursive, recursive = FALSE,
          copy.mode = TRUE)
file.symlink(from, to)
file.link(from, to)
Sys.junction(from, to)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值