Export package

2

Personnel I created a package in R, is already with the documentation, with @export in each function, I ask the Rstudio to create the package and everything right. But when I import the package it reads the documents all, it helps of all functions, but does not read the function properly. That is, ?funcao worked, but funcao(x) says that it did not find the function.

Issue 1

Being accurate, this is how I have the functions inside NAMESPACE created by roxygen2 like this:

S3method(plot,polygon)
export(convex.verification)
export(polygon.intersection)
export(polygon.transformation)
export(polygonal.correlation)
export(polygonal.covariance)
export(polygonal.mean)

And the function that is not recognized at check is only plot.polygon

Does anyone have an idea whatsoever?

    
asked by anonymous 28.06.2016 / 04:17

1 answer

1

According to the book R-packages

  

Object names Variable and function names should be lowercase. Use an   underscore (_) to separate words within a name   methods). Camel case is a legitimate alternative, but be consistent!   Generally, variable names should be nouns and function names should be   verbs. Strive for names that are concise and meaningful (this is not   easy!).

I highlight the phrase:

  

Use an   underscore (_) to separate words within a name   methods).

That is: Use underline (_) to separate words in the name (.. of an object) (book for S3 methods)

I do not know exactly how S3 works and how roxygen2 behaves in its presence. My kick is that it does not export the function, just the method. Therefore, its function might work on an object with class polygon .

Example:

class(obj) <- "polygon"
plot(obj)

If this is not what you want, try replacing the point in the function name with underline (_).

    
28.06.2016 / 23:24