Hi All,
I'm trying to delete a row from my dataframe "pop" without changing the
indexing (column 0) as follows:
>pop
id birth size xloc yloc weight energy gonad consumed
1 1 36 13 34 43 0 18 0 0
2 2 36 10 39 38 0 18 0 0
3 3 36 10 37 35 0 18 0 0
4 4 36 10 31 25 0 18 0 0
5 5 36 17 34 43 0 18 0 0
By using:
>i=3
>pop=pop[-pop$id[i],]
id birth size xloc yloc weight energy gonad consumed
1 1 36 13 34 43 0 18 0 0
2 2 36 10 39 38 0 18 0 0
4 4 36 10 31 25 0 18 0 0
5 5 36 17 34 43 0 18 0 0
But what I really need is:
id birth size xloc yloc weight energy gonad consumed
1 1 36 13 34 43 0 18 0 0
2 2 36 10 39 38 0 18 0 0
3 4 36 10 31 25 0 18 0 0
4 5 36 17 34 43 0 18 0 0
*note the first column.
Any ideas?
THANKS!!!!
Nico
______________________________________________
R-help@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.