I am trying to use the mgcv-package, but the mgcv::gam-function only returns an error message
Tmean = c(1,3,10,5,7)
prec = c(300,500,700,600,500)
fit = mgcv::gam(Tmean ~ s(prec))
Error message:
Error in reformulate(pav, env = p.env) : unused argument (env = p.env)
I am using R Version R version 3.5.2 (2018-12-20) and installed mgcv package version 1.8-33. During the installation I also recognized this code lines
- byte-compile and prepare package for lazy loading Note: possible error in 'reformulate(av, response = ret[[1]]$response, ': unbenutztes Argument (env = p.env) Note: possible error in 'reformulate(pav, env = p.env)': unbenutztes Argument (env = p.env) ** help
I had the package "gam" previously installed and also had both loaded via library, which I found out was a bad idea.
R Package conflict between gam and mgcv?
I tried to detach and delete both packages and reinstalled only mgcv, but I get the same error. I am stuck here and also could not find a solution on the internet. Any suggestions how I could solve the problem?
The gam-function from the gam-package works as long as I do not load the mgcv-package via library.
This is also my first question on stackoverflow, so sorry if made any formatting errors or if I forgot some details in the question. Best, Josef