-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathdirs.Rd
66 lines (60 loc) · 1.78 KB
/
dirs.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
\name{dirs}
\alias{dirs}
\alias{dirs}
\alias{dirs}
\title{
Get subdirectories
}
\description{
If you want only subfolders and no files, use \code{dirs}.
With \code{recursive} = FALSE, \code{\link{dir}} returns both folders
and files. With \code{recursive} = TRUE, it returns only files.
}
\usage{
dirs(path='.', pattern=NULL, exclude=NULL, all.files=FALSE,
full.names=FALSE, recursive=FALSE, ignore.case=FALSE)
}
\arguments{
\item{path, all.files, full.names, recursive, ignore.case}{
as for \code{\link{dir}}
}
\item{pattern, exclude}{
optional regular expressions of filenames to include or exclude,
respectively.
}
}
\details{
1. mainDir <- dir(...) without recurse
2. Use \code{\link{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 \code{dirs} for each component of mainDir. Then
\code{\link{unlist}} and return the result.
}
\value{
A character vector of the desired subdirectories.
}
%\references{}
\author{
Spencer Graves
}
\references{
Ramsay, James O., Hooker, Giles, and Graves, Spencer (2009),
\emph{Functional data analysis with R and Matlab}, Springer, New York.
Ramsay, James O., and Silverman, Bernard W. (2005),
\emph{Functional Data Analysis, 2nd ed.}, Springer, New York.
Ramsay, James O., and Silverman, Bernard W. (2002),
\emph{Applied Functional Data Analysis}, Springer, New York.
}
\seealso{
\code{\link{dir}},
\code{\link{file.info}}
}
% \examples{
% dirs(path2fdaM)
% dirs(path2fdaM, full.names=TRUE)
% dirs(path2fdaM, recursive=TRUE)
% dirs(path2fdaM, exclude='^@|^private$', recursive=TRUE)
% }
\keyword{IO}% at least one, from doc/KEYWORDS