[R] Odp: Delete/insert rows in data matrix

Petr PIKAL petr.pikal at precheza.cz
Thu Jan 31 14:15:33 CET 2008


Hi

data[, -5] without fifth column
data[-5,] without fifth row
 rbind(data[1:2,], NA, data[3:4,]) insert row of NA

Regards

Petr
petr.pikal at precheza.cz

r-help-bounces at r-project.org napsal dne 31.01.2008 13:52:02:

> Hello all,
> 
> I have the following problem. I want to insert blank rows in an data 
frame
> so as to make it comparable with another data frame with more rows. How 
can
> I insert these rows?
> If this is not solvable, then, alternatively, is it easy to delete rows 
from
> a data frame?
> 
> Thanks for helping,
> Eleni
> 
>    [[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list