2
Guys I created a package in the R, already with the documentation, with the @export in each role, I ask for the Rstudio create the package and all right. But when I import the package it reads all the documents, helps of all functions, but does not properly read the function. That is to say, ?funcao functioned, but funcao(x) says that it did not find the function.
Issue 1.
Being precise, it’s like this, I have the functions within the NAMESPACE created by roxygen2 thus:
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 just the plot.polygon
Does anyone have any idea what it is?
see if NAMESPACE has the name of all functions, this file controls what appears and what does not.
– Daniel Falbel
As always, Hadley’s chapter on NAMESPACE explains very well what it is, how it works and why it exists, and gives several tips. http://r-pkgs.had.co.nz/namespace.html
– Molx
Also make sure you used the right syntax from Roxygen2 notation (
#' @exportjust before the definition of the function).– Molx
I found the mistake, it’s in
roxygen2is installing with error, I tried to reinstall, but will not, appears the message:Warning in install.packages : cannot remove prior installation of package roxygen2.– Wagner Jorge
Usually if you restart your computer this problem of removing the package installation is fixed. This happens often because you have some R session using the folder. But the
NAMESPACEI was really wrong?– Daniel Falbel
Yes, when
check, it asks for a function calledhellothat does not exist in the package and aborts, but runs all documentation just that functions remain non-existent.– Wagner Jorge
And a function that exists is not recognized.
– Wagner Jorge
I edited adding more information.
– Wagner Jorge
I don’t know much about
S3Methods, but I think the problem is there. Their idea is that they work without using Plot.Polygon, that it would just beploton a Polygon class object. I don’t know if roxygen2 follows this idea and stops exporting the function normally.– Daniel Falbel
Have you ever tried to use alone
plotin an object with classpolygon?– Daniel Falbel
Tried, gives error. This function plots several overlapping polygons connecting the points.
– Wagner Jorge
Let’s go continue this discussion in chat.
– Daniel Falbel