Hello list,

In ?Reduce:

   init: an R object of the same kind as the elements of ‘x’.

Seems like "the same kind" is an unnecessary and artificial restriction. 
Furthermore, there is no notion of "same kind" for heterogeneous lists:

   x <-  list(letters, c(TRUE, FALSE))

   Reduce(function(init, xx) {init + length(xx)}, x, init=100)
   # [1] 128

Thanks,
H.

-- 
Hervé Pagès

Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M1-B514
P.O. Box 19024
Seattle, WA 98109-1024

E-mail: hpa...@fredhutch.org
Phone:  (206) 667-5791
Fax:    (206) 667-1319
______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to