R软件包mgcv是否存在已知的兼容性问题?是否有通用的兼容性规则? [英] Are there known compatibility issues with R package mgcv? Are there general rules for compatibility?
问题描述
我使用R版本2.15.1(2012-06-22)和mgcv版本1.7-22
I use R version 2.15.1 (2012-06-22) and mgcv version 1.7-22
我在R中加载了以下软件包:
I load the following set of packages in R:
library(sqldf)
library(timeDate)
library(forecast)
library(xts)
library(tseries)
library(MASS)
library(mgcv)
碰巧我不能运行一个简单的模型(我省略了代码).甚至包括从帮助页面获取的示例代码:
It happens that I can not run a simple model (I omit the code). Even the sample code taken from the help pages:
dat = gamSim(1,n=400,dist="normal",scale=2)
b = gam(y~s(x0)+s(x1)+s(x2)+s(x3),data=dat)
出现错误:
Error in qr.qty(qrc, sm$S[[l]]) :
NA/NaN/Inf in foreign function call (arg 5)
In addition: Warning message:
In smoothCon(split$smooth.spec[[i]], data, knots, absorb.cons, scale.penalty = scale.penalty, :
number of items to replace is not a multiple of replacement length
请注意,如果我只是加载软件包mgcv,然后立即使用示例代码,则一切正常.如果我只是加载所有程序包并运行示例代码,它也将起作用.如果我
Note that everything works fine, if I just load the package mgcv and then use the sample code right away. It also works if I just load all the packages and run the sample code. It just does not work if I
- 加载所有程序包
- 从软件包预测中读取文件,sqldf语句,ts操作和一些模型.
- 如果我随后申请GAM,它将无法正常工作.
显然,一般环境中的变量定义会破坏程序包的功能.
Apparently the variable definitions in the general environment mess up the functioning of the package.
是否存在任何已知问题?如果加载各种程序包,我必须遵守一些通用规则吗?我可以编写打扰" mgcv软件包的代码吗?
Are there any known issues? Are there general rules that I have to obey if I load various packages? Can I write code that "disturbed" the package mgcv?
推荐答案
将mgcv加载为第一个程序包解决了我的问题……很奇怪,但确实如此.
Loading mgcv as the first package solved my problem ... strange but true.
这篇关于R软件包mgcv是否存在已知的兼容性问题?是否有通用的兼容性规则?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!