Hi > > SORRY! > > The data in MyTable are tagsets of photos, like this: > > V1 V2 V3 V4 V5 V6 V7 V8 > 230 green nailpolish barrym 0 0 0 0 0 > 231 ny green brooklyn cleanup clean gowanus volunteer gcc > 232 green saul lecture 0 0 0 0 0 > 233 green colors cores market colores marakesh mercado malu > 234 ny green brooklyn cleanup clean gowanus volunteer gcc > 235 green saul lecture 0 0 0 0 0 > 236 portrait pet white green cat canon square eos > > V9 V10 V11 V12 V13 V14 V15 > 230 0 0 0 0 0 0 0 > 231 gowanuscanalconservancy 0 0 0 0 0 0 > 232 0 0 0 0 0 0 0 > 233 malugreen maroc souk marrocos 0 0 0 > 234 gowanuscanalconservancy 0 0 0 0 0 0 > 235 0 0 0 0 0 0 0 > 236 is eyes mark taiwan ii mk2 5d > > > while data of MyVector is a list of tags (none of the columns in particular) > whose frequency in MyTable has to be computed. Like this: > > [1] "life" "wood" "pink" "house" "green" "fall"
What about changing your data frame to matrix and use table set.seed(111) x<-sample(letters, 200, replace=T) y<-letters[3:6] dim(x)<-c(20,10) dd<-data.frame(x) tt<-table(as.matrix(dd)) tt[names(tt) %in% y] c d e f 13 5 8 3 Regards Petr > > > > Thanks!! > > Marianna > > > -- > View this message in context: http://r.789695.n4.nabble.com/loop-for-a- > large-database-tp4422052p4422776.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > 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. ______________________________________________ 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.