[Rd] Controlling simplification in apply()?

From: Gavin Simpson <gavin.simpson_at_ucl.ac.uk>
Date: Mon, 20 Feb 2012 16:03:51 +0000

Dear list,

Fully according to the documented behaviour, I was bitten by apply() simplifying results to vectors or arrays when the lengths of the individual objects returns by FUN are the same (over simplification).

sapply() has argument simplify with default TRUE to control whether it attempts to simplify the returned objects or not.

I do find it a little annoying that one is not able to force apply into one behaviour or the other.

Would the be merit in apply() also having a similar argument to control whether simplification occurs or not, say adding `simplify = TRUE` after `...`? If there was I'd be happy to provide a first stab and contribute updated documentation.

All the best,



Dr. Gavin Simpson [t] +44 (0)20 7679 0522 ECRC, UCL Geography, [f] +44 (0)20 7679 0565 Pearson Building, [e] gavin.simpsonATNOSPAMucl.ac.uk Gower Street, London [w] http://www.ucl.ac.uk/~ucfagls/ UK. WC1E 6BT. [w] http://www.freshwaters.org.uk
______________________________________________ R-devel_at_r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Mon 20 Feb 2012 - 16:06:09 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 21 Feb 2012 - 13:10:19 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive