read.directory: Reading the files of a directory

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/system_and_package.R

Description

Reading the files of a directory.

Usage

1
2
read.directory(path.directory)
read.examples(path.man)

Arguments

path.directory

The full path to the directory. For example: \"C:\Users\username\Documents\R\Rfast_1.8.0\R\"

path.man

The full path to the directory with the Rd files in it. For example: \"C:\Users\username\Documents\R\Rfast_1.8.0\man\\"

Details

For function \"read.directory\": Takes as an argument a full path to a directory and returns the names of the files.

For function \"read.examples\": Takes as an argument a full path to the directory of the Rd files. If you don't want the program to read any file add at the top of the file the attribute "%[dont read]".

Value

For function \"read.directory\": The names of the files.

For function \"read.examples\": a list with 2 fields

examples

A character vector with the examples of each Rd file.

files

A character vector with the name of the file that each examples belongs.

long_lines

A character vector with the name of the file that has large examples.

You can choose which files not to read for both R and Rd. You must add in the first line of the file in comment the "attribute" "%[dont read]". Finally, that function wil return in the result a list of which files had this attribute.

Author(s)

R implementation and documentation: Manos Papadakis <papadakm95@gmail.com>.

See Also

AddToNamespace, sourceR, sourceRd, checkRd, checkExamples

Examples

1
2
3
4
5
6
7
# for example: path="C:\some_file\"
# system.time( read.directory(path) )
# system.time( list.dirs(path) )

# for example: path.man="C:\some_file\man\"
# system.time( read.examples(path.man) )
# system.time( read.examples(path.man,dont.read=c("somef_1.Rd",...,"somef_n.Rd") ) )

Example output

Loading required package: Rcpp
Loading required package: RcppZiggurat

Rfast documentation built on May 18, 2021, 1:07 a.m.