Re: [R] subsetting dataframe by rownames to be excluded

2008-10-13 Thread David Winsemius
On Oct 13, 2008, at 5:36 AM, Dieter Menne wrote: Prof Brian Ripley stats.ox.ac.uk> writes: Yes: DF[is.na(match(row.names(DF), exclude_me)), ] Assuming everything is possible in R: would it be possible to make the below work without breaking existing code? a <- data.frame(x=1:10) rowna

Re: [R] subsetting dataframe by rownames to be excluded

2008-10-13 Thread Prof Brian Ripley
On Mon, 13 Oct 2008, Dieter Menne wrote: Prof Brian Ripley stats.ox.ac.uk> writes: Yes: DF[is.na(match(row.names(DF), exclude_me)), ] Assuming everything is possible in R: would it be possible to make the below work without breaking existing code? It would be possible, but not I think des

Re: [R] subsetting dataframe by rownames to be excluded

2008-10-13 Thread Dieter Menne
Prof Brian Ripley stats.ox.ac.uk> writes: > Yes: DF[is.na(match(row.names(DF), exclude_me)), ] Assuming everything is possible in R: would it be possible to make the below work without breaking existing code? a <- data.frame(x=1:10) rownames(a) = letters[1:10] exclude = c("a","c") a[is.na(matc

Re: [R] subsetting dataframe by rownames to be excluded

2008-10-11 Thread Prof Brian Ripley
On Sat, 11 Oct 2008, Alexy Khrabrov wrote: Is there a way to select a subset of a dataframe consisting of all those rows with rownames *except* from a subset of rownames to be excluded? Example: Yes: DF[is.na(match(row.names(DF), exclude_me)), ] a <- data.frame(x=1:10,y=10:1) a <- a[order

[R] subsetting dataframe by rownames to be excluded

2008-10-11 Thread Alexy Khrabrov
Is there a way to select a subset of a dataframe consisting of all those rows with rownames *except* from a subset of rownames to be excluded? Example: > a <- data.frame(x=1:10,y=10:1) > a <- a[order(a$y),] # to make rownames differ visually > a[8,] x y 3 3 8 > a["8",] x y 8 8 3 > a[-