On Wed, 14 Aug 2013, Hervé Pagès wrote:
Hi Zhang,
First note that a list is a vector (try is.vector(list())).
The documentation for sapply() and Vectorize() should say *atomic*
vector instead of vector in the desccription of the 'simplify' and
'SIMPLIFY' arguments.
So in order for sapply() to be able to simplify the result, all runs
of the function not only need to produce an atomic vector of the same
type, but also of the same length. If this common length is 1, then the
final result can be simplified to an atomic vector of the same length
as the input.
Thanks. Thanks to Jeff Newmiller as well, you answered clearly and the
answer solves the problem.______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.