R:NA / NaN / Inf在外部函数调用中(arg 1) [英] R: NA/NaN/Inf in foreign function call (arg 1)
本文介绍了R:NA / NaN / Inf在外部函数调用中(arg 1)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我使用名为HydroMe的软件包来适应模型时,一些数据组将返回以下错误:
Error in qr.default(.swts * attr(rhs,gradient)):
NA / NaN / Inf在外部函数调用中(arg 1)
实际上,数据组中没有缺失值。
的代码如下:
library(HydroMe)
fortest< -read.csv(file =F:/fortst.csv)
van.lis< -nlsList(y〜SSvan(x,Thr,Ths,alp,scal)| Sample,data = fortst)
示例数据可以从这里下载:
http://www.fileden.com/files/2012/9/13/3346981/fortst.csv
< Ths
,<$> scal
不在您的数据框中或 fortst.csv
。因此,当它们在 y〜SSvan(x,Thr,Ths,alp,scal)| Sample
公式中被引用时,它们就是NA。
When i use a package named HydroMe to fit a model, some data groups will return the following errors:
Error in qr.default(.swts * attr(rhs, "gradient")) :
NA/NaN/Inf in foreign function call (arg 1)
Actually,there is no missing value in the data groups. the codes are as followed:
library(HydroMe)
fortst<-read.csv(file="F:/fortst.csv")
van.lis <-nlsList(y~SSvan(x,Thr, Ths, alp, scal)|Sample,data=fortst)
the example data canbe download from here:
http://www.fileden.com/files/2012/9/13/3346981/fortst.csv
解决方案
The variables Thr
, Ths
, alp
, and scal
are not in your data frame or in fortst.csv
. Thus, when they're referred to in the y~SSvan(x,Thr, Ths, alp, scal)|Sample
formula, they're NA.
这篇关于R:NA / NaN / Inf在外部函数调用中(arg 1)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文