Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

AddToNamespace

Insert/remove function names in/from the NAMESPACE file


Description

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

Usage

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

Examples

## 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

A Collection of Efficient and Extremely Fast R Functions

v2.0.1
GPL (>= 2.0)
Authors
Manos Papadakis, Michail Tsagris, Marios Dimitriadis, Stefanos Fafalios, Ioannis Tsamardinos, Matteo Fasiolo, Giorgos Borboudakis, John Burkardt, Changliang Zou, Kleanthi Lakiotaki and Christina Chatzipantsiou.
Initial release
2020-09-13

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.