[R] removing columns

Uwe Ligges ligges at statistik.tu-dortmund.de
Tue May 3 13:24:10 CEST 2011



On 03.05.2011 13:16, nuncio m wrote:
> Hi list,
>
> I have a matrix with all elements of some columns are zeroes.  Is it
> possible to remove these columns:


Xnew <- X[ , as.logical(colSums(X)), drop=FALSE]

Uwe Ligges


> and create a new matrix
> nuncio
>
>
>
>



More information about the R-help mailing list