Check Namespace and Rd files {Rfast}R Documentation

Check Namespace and Rd files

Description

Check Namespace/Rd and examples files.

Usage

checkNamespace(path.namespace,path.rfolder)
checkAliases(path.man,path.rfolder)
checkTF(path.man)
checkExamples(path.man,package,each = 1,print.errors = stderr(),
	print.names = FALSE)
checkUsage(path.man,path.rfolder)

Arguments

path.namespace

An full path to the "NAMESPACE" file.

package

A character vector with the name of the package.

path.rfolder

An full path to the directory that contains the "R" files.

path.man

An full path to the directory that contains the "Rd" files.

each

An integer value for running each example.

print.errors

Print the errors to a file. By default it's "stderr()".

print.names

A boolean value (TRUE/FALSE) for printing the names of the files before running the examples.

Details

checkNamespace: reads from the NAMESPACE folder all the export R functions, reads from folder R all the R functions and check if all the functions are export.

checkAliases: reads from the man directory all the Rd files, then reads from each file the aliases and check if:

checkExamples: reads from the man directory all the Rd files, then read from each file the examples and then run each of them. If you want to print the errors in any file then set "print.errors=file_name" or in the standard error "print.errors=stderr()" and then you will see all the errors for every file. Set to argument "package" the name of your package. The argument "print.names" it is very helpful because if any of you function crashes R during running you will never know which one was. So setting it "TRUE", it will print the name of each file before running it's example.It might crash, but you will know which file. Remember that there is always an error timeout so it might didn't crash the current file but one from the previous.

checkTF: reads from the man directory all the Rd files, then read from each file the examples and checks if any examples has the values "T" and "F" instead "TRUE" and "FALSE". The "T","F" is wrong.

checkUsage: reads from the man directory all the Rd files and for each man check if the usage section has the right signature for the functions from the R directory.

checkTF, checkUsage, checkAliases: 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]". Then each function will know which file to read or not. For Rd you add "%[dont read]" and for R "#[dont read]". Finally, these functions will return in the result a list of which files had this attribute.

Value

checkNamespace: a vector with the names of missing R files. (Don't use it for now)

checkAliases: a list with 4 fields.

checkExamples: a list with 3 fields

checkTF: a list with 3 fields

checkUsage: a list with 3 fields

Author(s)

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

See Also

read.directory, AddToNamespace, sourceR, sourceRd, read.examples

Examples


	#for example: path.namespace="C:\some_file\NAMESPACE"
	#for example: path.rfolder="C:\some_file\R\"
	#for example: path.man="C:\some_file\man\"
	#system.time( a<-checkNamespace(path.namespace,path.rfolder) )
	#system.time( b<-checkAliases(path.man,path.rfolder) )
	#system.time( b<-checkExamples(path.man) )
	#system.time( b<-checkExamples(path.man,2) )
	#system.time( b<-checkTF(path.man) )
	#system.time( b<-checkTF(path.man,path.rfolder) )


[Package Rfast version 2.1.0 Index]