Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.Call improperly formed #7

Open
halpo opened this issue Sep 17, 2012 · 0 comments
Open

.Call improperly formed #7

halpo opened this issue Sep 17, 2012 · 0 comments

Comments

@halpo
Copy link
Owner

halpo commented Sep 17, 2012

from Prof. Brian Ripley:

For a package with a namespace (all these days), .C etc are allowed
without a PACKAGE argument to refer to entry points in the package,
but that was never checked.

I wrote some diagnostic code, and the namespace identification is not
doing a particularly good job. For example calls like

 drop(.C(...))
 do.call(".C", args)

are all missed, including some in your package (and ca 25 others). We
will do better in R-devel, but if you want the package to work well in
earlier versions you should add PACKAGE arguments.

An even better idea is to register your entry points and refer to them
as R objects. This is done extensively in R itself, so for example
fisher.test contains

    else PVAL <- .C(C_fexact, nr, nc, x, nr, as.double(-1), 
        as.double(100), as.double(0), double(1), p = double(1), 
        as.integer(workspace), mult = as.integer(mult), PACKAGE = "stats")$p

(and the PACKAGE = "stats" is not actually needed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant