AddToNamespace: Insert/remove function names in/from the NAMESPACE file

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

View source: R/system_and_package.R

Description

Insert/remove function names in/from the NAMESPACE file.

Usage

1
2
AddToNamespace(path.namespace,path.rfolder)
RemoveFromNamespace(path.namespace,files.to.remove)

Arguments

path.namespace

An full path to the NAMESPACE file.

path.rfolder

An full path to the directory the new files to be added are stored.

files.to.remove

An character with the names of the functions to be removed from file NAMESPACE.

Details

AddToNameSpace: Reads the files that are exported in NAMESPACE and the functions that are inside rfolder (where R files are) and insert every function that is not exported. For that you must add the attribute "#[export]" above every function you wish to export. Also you can use the attribute "#[export s3]" for exporting S3methods. Finally, if you don't want the program to read a file just add at the top of the file the attribute "#[dont read]".

RemoveFromNamespace: Remove every function, from argument "files.to.remove", from NAMESPACE.

Value

AddToNameSpace: Return the files that didn't have the attribute "#[export]" or empty character vector if all the files was inserted.

RemoveFromNamespace: Return the files that could not be removed.

Author(s)

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

See Also

colShuffle, colVars, colmeans, read.directory

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Not run: 
	for example: path.namespace="C:\some_file\NAMESPACE" where is NAMESPACE file
	path.rfolder="C:\some_file\R\" where is R files are
	system.time( a<-AddToNamespace(path.namespace,path.rfolder) )
	if(length(a)==0){
		print("all the files are inserted")
	}else{
		print("The new files that inserted are: \n")
		a
	}
	system.time( a<-RemoveFromNamespace(path.namespace,c("a","b")) )
	if(length(a)==0){
		print("all the files are inserted")
	}else{
		print("The files thatcould not be deleted are: \n")
		a
	}

## End(Not run)

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