Closed alexploner closed 2 years ago
R 4.1.0 on Ubuntu 21.10, summarytools 1.0.0
Calls to descr that only specify one summary statistic will crash:
> descr(rnorm(100), stats = "mean") Error in if (colnames(output)[i] == "sd") { : argument is of length zero
Regardless whether I feed it a vector or a data frame:
> descr(cars, stats = "mean") Error in if (colnames(output)[i] == "sd") { : argument is of length zero
From a quick look with debug, the problem seems to be this line of code in descr:
output <- output[, stats]
where the output object loses its data frame status; replacing it with
output
output <- output[, stats, drop = FALSE]
should solve the issue.
Thanks for a great package!
Thx for reporting this, should be fixed in next release.
Fixed.
R 4.1.0 on Ubuntu 21.10, summarytools 1.0.0
Calls to descr that only specify one summary statistic will crash:
Regardless whether I feed it a vector or a data frame:
From a quick look with debug, the problem seems to be this line of code in descr:
where the
output
object loses its data frame status; replacing it withshould solve the issue.
Thanks for a great package!