add: add a new method to the package

addR Documentation

add a new method to the package

Description

This function is an interface to extend the package. A user can define a new method and add it to the package. When the method is successfully added, it can be used along with other existing methods. The names of available methods in the package can be seen using the getmethodNames function. It is not limited only to the modelling methods, but can also be used for a replication method, or those used to generate pseudo-absences (backgrounds), etc.

You can get definitions for an existing method as an object using getmethod.

Usage

add(x,w,echo,...)

getmethod(x,w,...)

getmethodNames(w,...)

Arguments

x

Either a list, or an object generated by getmethod function

w

specify which group of methods the new method belongs to. "sdm" (default) can be used for modelling method

echo

logical (default=TRUE), determines whether a message should be printed to report if the adding is successful

...

additional arguments. see details

Details

These functions provide flexibility to extend the package by users through adding new methods to the package. It is also possible to add several instances of an existing method which, for example, edited to use the same method with different settings at the same time. Whatever the new method is, it can also be shared and used by other users.

Value

getmethod gives an object of an appropriate class depending on w.

getmethodNames generates a list (if alt=TRUE is provided as an additional argument) containing the name of methods and all alternative names (aliases) specified for each method, or a character vector (if alt=FALSE) containing the main abbreviation names of the existing methods.

Author(s)

Babak Naimi naimi.b@gmail.com

https://www.r-gis.net/

https://www.biogeoinformatics.org/

References

Naimi, B., Araujo, M.B. (2016) sdm: a reproducible and extensible R platform for species distribution modelling, Ecography, 39:368-375, DOI: 10.1111/ecog.01881

Examples

## Not run: 
getmethodNames('sdm')

## End(Not run)

babaknaimi/sdm documentation built on April 4, 2024, 1:45 p.m.