TheoreticalEcosystemEcology / alien

Predict All Links In Ecological Networks
MIT License
12 stars 0 forks source link

We need to change our naming convention -> accidental S3 methods #15

Closed bw4sz closed 7 years ago

bw4sz commented 7 years ago

I think we are accidentally creating S3 export methods (i.e a predict generic class), by mistake. I noticed that.

For example, the function cannot be called, but is exported and documented.

library(alienR) 
> library(alienR)
> predict.bayesreg
Error: object 'predict.bayesreg' not found
> ?predict.bayesreg

works fine. http://r-pkgs.had.co.nz/man.html

see Documenting classes, generics and methods. I think what is happening is predict.bayesreg is a predict generic function for a class bayesreg. I do not know how to set a class, or whether output objects automatically have classes? I suggest we just change all functions from . to _ . For example, predict.bayesreg becomes predict_bayesreg

bw4sz commented 7 years ago

playing around with @exportClass tag in the roxygen docs.

bw4sz commented 7 years ago

I changed my names, as part of pull request #11

SteveViss commented 7 years ago

Hi @bw4sz,

The convention on functions and object names are already written in the README. Have a look at the first and second bullet points in styleguide section:

I'll change tomorrow all the names already declared in the package according to these. Cheers, Steve

bw4sz commented 7 years ago

Looks like steve took care of this.