79160780

Date: 2024-11-05 21:50:13
Score: 1
Natty:
Report link

Try adding "simplify = FALSE" to your apply function:

mat <- matrix(1:6, ncol=2)
f <- function (x) cbind(1:sum(x), sum(x):1)
do.call(rbind, apply(mat, 1, f))

mat <- f(3)
apply(mat, 1, f, simplify = FALSE)
do.call(rbind, apply(mat, 1, f, simplify = FALSE))
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Rob Moses