I am running H2fun() of the 'bipartite' class in R studio using R version 3.6.1.
Inputting a 20x20 matrix of non-integers where the values is each column sum to 1, it appears that when I run this function with H2_integer set to false, H2_max is never defined before the comparison with H2_max.improved is performed
The error message is:
Error in ifelse(H2_max >= H2_max.improved, H2_max, H2_max.improved) :
object 'H2_max' not found
Looking at the source code it appears that the line:
H2_max <- -sum(newweb/tot*log(newweb/tot), na.rm=TRUE) # first attempt of finding H2_max
only executes in the else block where H2_integer is TRUE.
I am running H2fun() of the 'bipartite' class in R studio using R version 3.6.1.
Inputting a 20x20 matrix of non-integers where the values is each column sum to 1, it appears that when I run this function with H2_integer set to false, H2_max is never defined before the comparison with H2_max.improved is performed
The error message is:
Error in ifelse(H2_max >= H2_max.improved, H2_max, H2_max.improved) : object 'H2_max' not found
Looking at the source code it appears that the line:
H2_max <- -sum(newweb/tot*log(newweb/tot), na.rm=TRUE) # first attempt of finding H2_max
only executes in the else block where H2_integer is TRUE.