Skip to content
Prev 139160 / 398506 Next

combining/deleting rows

"Suran, Luciana @ Torto Wheaton Research"
<Luciana.Suran at tortowheatonresearch.com> wrote in
news:09EBE0E1A7DEA24CAD5EA6827A7EB16D0C620EF5 at usidcxmb02.us.cbre.net:
You posted your email in response to a question that had nothing to do 
with this question. If you have new question, you should not send a 
reply to someone else's question.
<snipped single element per line listing with 47 elements>


The lines you posted had no organization that would suggest they had 
ever been part of a data.frame. The first 5 elements looked to be 
variable names. But the number of elements was not evenly divisible by 
5.  Can you post a new message with complete data and the code (or 
method) that you used to bring this data into the R environment?
If this is arranged as only one column, and you wanted the value in row 
24, then the code might be:

df[24] <- df[24] + df[1]
You could assign another object the values in the first object rows 
that you wanted kept:

df2 <- df[c(1:3, 5:10), ]

Or you could exclude the rows you wanted dropped using a minus-sign:

df2 <- df[-4,]

df2 <- df[-c(2,5,8), ]