Re: [R] Is simplify2array working for dimension > 2?

2024-02-09 Thread Jean-Claude Arbaut
Re your mention in your other mail (which didn't go to r-help) of this part of the doc: "The default value, TRUE, returns a vector or matrix if appropriate, whereas if simplify = "array" the result may be an array of “rank” (==length(dim(.))) **one higher than the result of FUN(X[[i]]).**" It's

Re: [R] Is simplify2array working for dimension > 2?

2024-02-08 Thread Bert Gunter
Jean-Claude: Well, here's my "explanation". Caveat emptor! Note that: "simplify2array() is the utility called from sapply() when simplify is not false" and > sapply(a, I, simplify = "array") [,1] [,2] [1,] list,2 list,2 [2,] list,2 list,2 So it seems that simplify2array() is not

[R] Is simplify2array working for dimension > 2?

2024-02-08 Thread Jean-Claude Arbaut
Reading the doc for ?simplify2array, I got the impression that with the 'higher = T' argument the function returns an array of dimension greater than 2 when it makes sense (the doc says "when appropriate", which is rather vague). I would expect a <- list( list(list(1, 2), list(3, 4)),