From gavin.simpson at ucl.ac.uk  Mon Feb 20 17:03:51 2012
From: gavin.simpson at ucl.ac.uk (Gavin Simpson)
Date: Mon, 20 Feb 2012 16:03:51 +0000
Subject: [Rd] Controlling simplification in apply()?
Message-ID: <1329753831.4528.86.camel@prometheus.geog.ucl.ac.uk>

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,

Gavin
-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
 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
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%



[Rd] Controlling simplification in apply()?
Gavin Simpson