Commit 58fbae69 authored by nperez's avatar nperez
Browse files

attributes can be length zero

parent 0359300c
Pipeline #2336 passed with stage
in 1 minute and 21 seconds
......@@ -13,8 +13,10 @@
x <- x[as.vector(y)]
}
dim(x) <- old_dims[new_order]
if (names(attr_bk) == 'dimnames') {
attr_bk <- list(dimnames = attr_bk$dimnames[new_order])
if (length(attr_bk) > 0) {
if (names(attr_bk) == 'dimnames') {
attr_bk <- list(dimnames = attr_bk$dimnames[new_order])
}
}
attributes(x) <- c(attributes(x), attr_bk)
x
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment