[R] Deleting multiple rows from a matrix

Romain Francois francoisromain at free.fr
Wed May 25 09:58:48 CEST 2005


Le 25.05.2005 09:55, Gottfried Gruber a Ã©crit :

>Hi,
>
>i want to delete multiple rows from a matrix. I know how to delete one by
>x=x[,-3]  # deleting 3. column
>
>Is there a quick method how to delete e.g. the 3., 5., 7. and 8. column at 
>once?
>
>TiA gg
>
>  
>
Same way. Only just provide a vector, as in :
x = x[,-c(3,5,7)]

Romain

-- 
visit the R Graph Gallery : http://addictedtor.free.fr/graphiques
~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~
~~~~~~      Romain FRANCOIS - http://addictedtor.free.fr         ~~~~~~
~~~~        Etudiant  ISUP - CS3 - Industrie et Services           ~~~~
~~                http://www.isup.cicrp.jussieu.fr/                  ~~
~~~~           Stagiaire INRIA Futurs - Equipe SELECT              ~~~~
~~~~~~   http://www.inria.fr/recherche/equipes/select.fr.html    ~~~~~~
~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~




More information about the R-help mailing list