package.dir(package='base', lib.loc=NULL, exclude=c('chtml', 'data', 'help', 'html', 'latex', 'libs', 'man', 'Meta', 'po', 'R', 'R-ex', 'src'), include=NULL, pattern=NULL, recursive=FALSE)
2. Dir <- dir(fullPath)
3. Restrict Dir only to 'include' if provided and to all but 'exclude' otherwise.
4. If recursive, return a list produced by dir for each of the subdirectories of interest determined in step 3. Else, return only the list of subdirectories from step 3.
system.file
dir
file.path
package.dir() # 'demo'
package.dir(recursive=TRUE) # contents of 'demo'
package.dir('nlme') # 'mlbook', 'scripts'
Run the code above in your browser using DataLab