Closed perblock closed 8 months ago
Additionally, this throws an error, but should not: myState <- createProcessState( list( transfers = transfers, people = people, organisations = organisations), dependentVariable = "transfers")
And this gives an odd warning that disappears when the line with sex or with second_or is removed: myState <- createProcessState( list( transfers = transfers, people = people, organisations = organisations, sameRegion = sameRegion, region = region, size = size, sex = sex, second_or = second_or), dependentVariable = "transfers")
Found if() conditions comparing class() to string: File ‘MoNAn/R/1_hiddenFunctions.R’: if (!(class(state[[dep.var]]) == "edgelist.monan")) ... File ‘MoNAn/R/1_hiddenFunctions.R’: if (!(class(state[[nodesets[i]]]) == "nodeSet.monan")) ... File ‘MoNAn/R/1_hiddenFunctions.R’: if (!(class(state[[covars[i]]]) == "nodeVar.monan" || class(state[[covars[i]]]) == "network.monan")) ... Use inherits() (or maybe is()) instead.
=> adjusted, uses inherits() now
Additionally, this throws an error, but should not: myState <- createProcessState( list( transfers = transfers, people = people, organisations = organisations), dependentVariable = "transfers")
=> did throw an error because there were no covars in the example code, now covars are only checked if there actually are covars in the state object
And this gives an odd warning that disappears when the line with sex or with second_or is removed: myState <- createProcessState( list( transfers = transfers, people = people, organisations = organisations, sameRegion = sameRegion, region = region, size = size, sex = sex, second_or = second_or), dependentVariable = "transfers")
=> problem was that sameRegion is assigned to the same nodeset (organisations) twice which results in a length of 2 => if this object of length two is compared ("==") to another object of a length which is not a multiple of 2, a warning is given => solved using "%in%" instead of "=="
Found if() conditions comparing class() to string: File ‘MoNAn/R/1_hiddenFunctions.R’: if (!(class(state[[dep.var]]) == "edgelist.monan")) ... File ‘MoNAn/R/1_hiddenFunctions.R’: if (!(class(state[[nodesets[i]]]) == "nodeSet.monan")) ... File ‘MoNAn/R/1_hiddenFunctions.R’: if (!(class(state[[covars[i]]]) == "nodeVar.monan" || class(state[[covars[i]]]) == "network.monan")) ... Use inherits() (or maybe is()) instead.