gstudio
gstudio copied to clipboard
gstudio/R/partition.R
for line 29 of gstudio/R/partition.R, I believe the line should be changed from:
ret[[lvl]] <- droplevels( x[ x[[stratum]]==lvl, ] )
to:
ret[[lvl]] <- droplevels( x[ which(x[[stratum]]==lvl), ] )
in order to avoid empty rows of NA within each population corresponding to every line of the input data frame that doesn't match the stratum.
Also, if the stratum is formatted as a number rather than a character or a factor, the following error will be thrown: Error in rep(" ", max(nchar(names(pops)))) : invalid 'times' argument In addition: Warning message: In max(nchar(names(pops))) : no non-missing arguments to max; returning -Inf