gstudio icon indicating copy to clipboard operation
gstudio copied to clipboard

gstudio/R/partition.R

Open NorEasterMT opened this issue 3 years ago • 1 comments

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.

NorEasterMT avatar Apr 08 '21 15:04 NorEasterMT

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

NorEasterMT avatar Apr 08 '21 16:04 NorEasterMT