Prof Brian Ripley <ripley <at> 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(match(row.names(a), exclude)), ] # not really that easy to remember

a[-c(1,3),]
# In analogy....
a[-c(exclude),]   #invalid argument to unary operator
 

Dieter

______________________________________________
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.

Reply via email to