Displaying 3 results from an estimated 3 matches for "simplifies_".
Did you mean:
simplifies
2015 Aug 03
2
'vapply' not returning list element names when returned element is a length-1 list
Hi all
Sorry for the confusing title. I noticed the following inconsistency:
If i have a function that returns a named list with 2 (or more) elements,
then using 'vapply' retains the names of the elements:
> vapply(1:3, function(x) list("foo" = "bar", "hello" = "world"),
> vector("list", 2))
[,1] [,2] [,3]
foo
2015 Aug 05
0
'vapply' not returning list element names when returned element is a length-1 list
...roject.org] On Behalf Of Dean Attali
> If i have a function that returns a named list with 2 (or more) elements,
> then using 'vapply' retains the names of the elements:
> ....
> But if the function only returns one element, then the name "foo" is lost
vapply _always simplifies_ according to the documentation.
In the first case (function return value contains more than one element, and each ), vapply simplifies to a matrix of two lists (!). The names "foo" and "hello" have been added to the dimnames so you can tell which is which.
in the second case...
2015 Aug 06
0
'vapply' not returning list element names when returned element is a length-1 list
Quote----------------
> If i have a function that returns a named list with 2 (or more) elements,
> then using 'vapply' retains the names of the elements:
> ....
> But if the function only returns one element, then the name "foo" is lost
vapply _always simplifies_ according to the documentation.
In the first case (function return value contains more than one element, and each ), vapply simplifies to a matrix of two lists (!). The names "foo" and "hello" have been added to the dimnames so you can tell which is which.
in the second case...