R: NA/NaN/Inf in foreign function call (arg 1)

筅森魡賤 提交于 2019-12-22 10:48:10

问题


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

回答1:


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.




回答2:


One reason for this error could be that the variable defined in your data frame is different from their actual data type. for eg you define 'Char' for 'Date' vaiable .



来源:https://stackoverflow.com/questions/12390978/r-na-nan-inf-in-foreign-function-call-arg-1

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!