Displaying 1 result from an estimated 1 matches for "unsplit2".
Did you mean:
unsplit
2009 Nov 25
0
Possible bug in "unsplit" (PR#14084)
..."1" "11" "3" "11" "5" "1" "7" "3" "9" "5" "11"
i.e. not unique row names for the output x.
A simple fix is to add drop = drop to that argument, such that the
updated unsplit (here called unsplit2) is like this:
unsplit2 <- function (value, f, drop = FALSE)
{
len <- length(if (is.list(f)) f[[1L]] else f)
if (is.data.frame(value[[1L]])) {
x <- value[[1L]][rep(NA, len), , drop = FALSE]
rownames(x) <- unsplit(lapply(value, rownames), f, drop=drop) # note new
"drop=drop"...