[R] Is there a way to specify drop=FALSE as the global default?

Peng Yu pengyu.ut at gmail.com
Wed Nov 11 18:11:45 CET 2009


On Mon, Oct 19, 2009 at 7:57 PM, Peng Yu <pengyu.ut at gmail.com> wrote:
> tmp <- matrix(1:2)
> tmp
> tmp[,1,drop=FALSE]
>
>
> See the above example. Is there a way to make 'drop=FALSE' as global
> default, so that when I say 'tmp[,1]', R will treat it as
> 'tmp[,1,drop=FALSE]'?

Is there a way to set drop=FALSE globally? I can't remember to put
drop=FALSE to all the '[]'s. But this indeed causes some weird bugs
for me to figure out.




More information about the R-help mailing list