simsem / semTools

Useful tools for structural equation modeling
75 stars 36 forks source link

Package won't load due to method export #89

Closed netique closed 2 years ago

netique commented 3 years ago

Sometimes I get this message:

Error: package or namespace load failed for ‘semTools’:
 Function found when exporting methods from the namespace ‘semTools’ which is not S4 generic: ‘anova’

After quick experimenting on why I get this message and why semTools won't load (even when function is called "directly" using namespace, i.e. semTools::reliability(xyz)). I found that the problem occurs especially when VGAM package is loaded before. Perhaps you can replicate the issue with:

library(VGAM)
library(semTools)

It really seems that something is wrong with VGAM, but It passes R CMD Check successfully, as semTools does. But the error message above points to somethig that happened before library(semTools) and I run that in clean session. Maybe someone can elaborate more on the error and its cause and pass some hint to VGAM team if the bug is on their side. I am no expert on S4, so I can only guess... Many thanks!

P.S. You can share the issue in the wiki or elsewhere, so people know what could be the cause when they see the message.

matguidi commented 3 years ago

I confirm this issue. There seems to be an incompatibility between the two packages. On my system (Manjaro Linux, R 4.1), semTools will load only if VGAM is not installed. I haven't found a way to solve this so far.

TDJorgensen commented 3 years ago

Thomas Yee (maintainer of VGAM) just implemented a fix in his prerelease, which can be downloaded here: https://www.stat.auckland.ac.nz/~yee/VGAM/prerelease/

I cannot check it because I have a Mac. Could @matguidi check the Linux version?

install.packages("VGAM_1.1-6.tar.gz", type = "source", repos = NULL)

And hopefully @netique can check the Windows version?

install.packages("VGAM_1.1-6.zip", type = "binary", repos = NULL)
matguidi commented 3 years ago

I confirm that, in Linux, with this version of VGAM, both packages are loaded correctly in R.

netique commented 3 years ago

@TDJorgensen, many thanks, works flawlessly now on Windows!

TDJorgensen commented 3 years ago

Thanks for checking. Thomas Yee will be working on the package after the summer, and the next version that goes to CRAN shouldn't cause this problem.

TDJorgensen commented 2 years ago

VGAM was updated on CRAN in February. Can I close this issue now, or is anyone having the same problem?

netique commented 2 years ago

@TDJorgensen No problem over here!