DT = data.frame(x=rep(c("a","b","c"),each=3),
y=c(1,3,6), v=1:9, w=3:11,
z=LETTERS[1:9])
If I understand you right, and you want to select all rows where v>3 and
W<10
with(DT, DT[which(v>3 & w<10),])
x y v w z
4 b 1 4 6 D
5 b 3 5 7 E
6 b 6 6 8 F
7 c 1 7 9 G
you can use colSums, rowSums on this, but after removing the categorical
columns
Anto
--
View this message in context:
http://r.789695.n4.nabble.com/Subsetting-columns-in-data-table-tp4652048p4652049.html
Sent from the R help mailing list archive at Nabble.com.