structure(.External(.C_dotTclObjv, objv), class = "tclObj") - r

I'm tring to use the soilphysics package and the fitsoilwater funciton.
It works pretty well with simple data sets but fails when I try to use bigger data sets with thousands of records (which is not usual I agree).
this is the error I get, poorly understandable for a beginner
Error in structure(.External(.C_dotTclObjv, objv), class = "tclObj") :
[tcl] floating point value is Not a Number.
so this works well,
ref_h<-c(1,10,22,60,100,200,300,600)
ref_VWC<-c(0.40838,0.3823,0.36928,0.35342,0.3394,0.25122,0.21506,0.1787)
fitsoilwater(ref_VWC, ref_h)
the same principle with longer vectors doesn't work and gives the error I mentionned.
Any comment welcome

You may have an NA in ref_VWC:
> ref_h<-c(1,10,22,60,100,200,300,600)
> ref_VWC<-c(0.40838,0.3823,0.36928,0.35342,0.3394,0.25122,0.21506,0.1787)
> fitsoilwater(ref_VWC, ref_h)
works fine, but then:
> ref_VWC[4]=NA
> fitsoilwater(ref_VWC, ref_h)
Error in structure(.External(.C_dotTclObjv, objv), class = "tclObj") :
[tcl] floating point value is Not a Number.

Related

How to set 'importance' for finding variable importance for various regression learners in mlr3

while using regr.ranger I'm getting an error message that says importance.mode must be one of "impurity" etc.
While using regr.rfsrc it says I should specify 'importance' to one of 'TRUE' etc.
I just want to understand at what stage should I assign the value to 'importance'.
I get an error if I do it while creating the learner.
> lrnr_ranger = mlr_learners$get(key = "regr.ranger",importance="impurity")
Error in initialize(...) : unused argument (importance = "impurity")
or
> lrnr_ranger = mlr_learners$get(key = "regr.ranger",importance.mode="impurity")
Error in initialize(...) : unused argument (importance.mode = "impurity")
or should I try to set it using the param_set:
> lrnr_ranger$param_set$add(p = list("importance.mode","impurity"))
Error in .__ParamSet__add(self = self, private = private, super = super, :
Assertion on 'p' failed: Must inherit from class 'Param'/'ParamSet', but has class 'list'.
Any clue would be super helpful.
I'm not really reporting a problem but asking how to do something. (Hence, I believe no need to create a reprex!)
I wish this was addressed in the mlr3 book or some documentation but it is not.
This is explained on the learners page of the mlr3 book, in particular at the end:
lrn_ranger = lrn("regr.ranger", importance = "impurity")

Error in if (more || nchar(output) > 80) when using mgcv

I have the same problem with this one but no solutions found yet
.
Error in if (more || nchar(output) > 80) { : missing value where TRUE/FALSE needed
I am conducting analysis using the mgcv package.
model1<-gam(fm_xsetz~total_pm2.5, data=analysis)
I can get the results by using the summary(). But when I try to open the model in the global environment, I get the warning:
Error in if (more || nchar(output) > 80) { : missing value where
TRUE/FALSE needed
Is anyone has the same problem?
FYI,when you use the following code:
library(geostatsp)
data(swissRain)
same problem happens!
I have/had a similar problem when I tried to view a List generated trough a function that computes the intersect/difference of two sets of 23000 observations each.
The function in question:
jeepers.creepers<-function(dfx,dfy,by.x,by.y){
SetX<-dfx[[by.x]]
SetY<-dfy[[by.y]]
Union.X.Y<-intersect(SetX,SetY)
Difference.in.X<-setdiff(SetX,Union.X.Y)
Difference.in.Y<-setdiff(SetY,Union.X.Y)
result<-list(Union.X.Y,Difference.in.X,Difference.in.Y)
names(result)<-c("Union of SetX and SetY",
"Unique in SetX",
"Unique in SetY")
return(result)
}
It gave me this error:
Error in if (more || nchar(output) > 80) { :
missing value where TRUE/FALSE needed
Nevertheless I could view the elements individually with
View(list$element)
I had a similar problem yet I could view it with:
view(as.data.frame(df))

using arulesSequences package : Error in makebin(data, file) : 'sid' invalid

I am using arulesSequences package in R. The documentation is too little for the type of data that read_baskets function receives. I guess data should be in text (.txt) format. Column names are: "sequenceID", "eventID", "SIZE" and "items". My data has about 200,000 rows and looks like following in z.txt file:
1,1364,3,{12,17,19}
1,1130,4,{14,17,21,23}
1,1173,3,{19,23,9}
1,98,5,{14,15,2,21,5}
2,1878,4,{1,10,14,3}
2,1878,13,{1,12,14,15,16,17,18,19,2,21,24,25,5}
2,1878,1,{2}
I tried to use:
x <- read_baskets("z.txt", sep = ",",info =c("sequenceID","eventID","SIZE"))
s <- cspade(x,parameter = list(support = 0.001),control = list(verbose =
TRUE),tmpdir = tempdir())
but I get this error :
Error in makebin(data, file) : 'sid' invalid
The combination of sequenceID and eventID must be unique.
Otherwise you'll get one of these errors:
Error in makebin(data, file) : 'sid' invalid
Error in makebin(data, file) : 'eid' invalid
This implies further that the items in your .txt file (per sequenceID, eventID combination) must be in the same row and (possibly) be separated with the same separator as the rest of the .txt file. Therefore, the item column should be the last column.
Hope this helps!
Ok I found the problem, and I'm posting it in case that some one has the same problem. The problem is both SequenceID and eventID (first and second columns must be ordered blockwise. package mentions this point, but I only ordered the first column.

“guiWidgetsToolkittcltk” is not a defined class

I want to create GUI using gWidget in R but I am getting all these kind of weird errors:
guitoolkit = new("guiWidgetsToolkittcltk")
Error in getClass(Class, where = topenv(parent.frame())) :
“guiWidgetsToolkittcltk” is not a defined class
or:
> setIs("guiWidget","guiWidgetORgWidgetTcltkORtcltk")
Error in .walkClassGraph(classDef, "subclasses", where) :
the 'subClass' list for class “guiWidgetORgWidgetTcltkORtcltk”, includes an undefined class “guiWidget”
Any idea what I am missing?

Error in sort.list(y) : invalid input in 'utf8towcs' using ore.pull()

I am trying to read data from database using ore.pull() and get
Error in sort.list(y) : invalid input 'Время работы' in 'utf8towcs'
'Время работы' is a value of the table. The other table, including russian text, is red with no warnings.
When I try to use such as construction:
data<-ore.doEval(function(){
library(ORE)
ore.connect(user="rquser", sid="testmcod", host="", password="rquser", port=1521, all=FALSE)
ore.sync(table = c("C_REPORT_VALUES"))
ore.attach()
ore.pull(C_REPORT_VALUES)
})
, I get the following result: <c2><f0><e5><ec><ff> <f0><e0><e1><ee><f2><fb>
which is char containing 'Время работы'
Any ideas to this problem? Thanks.

Resources