Description Usage Arguments Details Value Author(s) See Also Examples
If you want only subfolders and no files,
use dirs
. With recursive
=
FALSE, dir
returns both
folders and files. With recursive
=
TRUE, it returns only files.
1 2 3 |
path, all.files, full.names, recursive, ignore.case |
as for |
pattern, exclude |
optional regular expressions of filenames to include or exclude, respectively. |
1. mainDir <- dir(...) without recurse
2. Use file.info
to restrict mainDir to only
directories.
3. If !recursive, return the restricted mainDir. Else, if
length(mainDir) > 0, create dirList to hold the results of the
recursion and call dirs
for each component of mainDir. Then
unlist
and return the result.
A character vector of the desired subdirectories.
Spencer Graves
1 2 3 4 5 6 7 8 9 10 11 12 | path2fdaM <- system.file('Matlab/fdaM', package='fda')
dirs(path2fdaM)
dirs(path2fdaM, full.names=TRUE)
dirs(path2fdaM, recursive=TRUE)
dirs(path2fdaM, exclude='^@|^private$', recursive=TRUE)
# Directories to add to Matlab path
# for R.matlab and fda
R.matExt <- system.file('externals', package='R.matlab')
fdaM <- dirs(path2fdaM, exclude='^@|^private$', full.names=TRUE,
recursive=TRUE)
add2MatlabPath <- c(R.matExt, path2fdaM, fdaM)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.