Skip to content
Back to formatted view

Raw Message

Message-ID: <1319376655479-3930273.post@n4.nabble.com>
Date: 2011-10-23T13:30:55Z
From: Brad Patrick Schneid
Subject: how to delete rows by a list of rownames
In-Reply-To: <1319374391163-3930206.post@n4.nabble.com>

here is one way

df1 <- data.frame(c(1:20), c(21:40), c(31:50))
list1 <- c(3, 6, 20)
df2 <- df1[-list1,]





hanansela wrote:
> 
> Hello
> I have a list of row names that needs to be deleted from a data frame. How
> do i do that? 
> one of the columns in the data frame contains the row names as numbers. I
> can also select by this column (will it be easier?). 
> Thank you
> 


--
View this message in context: http://r.789695.n4.nabble.com/how-to-delete-rows-by-a-list-of-rownames-tp3930206p3930273.html
Sent from the R help mailing list archive at Nabble.com.