Is it possible to violate the identity sum(table(v)) == length(v) ?? I see no way to do that and it holds in my small examples, but it is violated in the huge set I have:
system.time(z <- unique(data.frame(u=U,s=S))) tab1 <- table(z$u) tab1 <- tab1[tab1>0] # S is factor so some counts were 0 tab2 <- table(z$s) stopifnot(length(tab2) == nrow(z)) # yes stopifnot(sum(tab1) == nrow(z)) ### no! sum(tab1) 728587 length(tab1) 503374 length(tab2) 2112951 -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000 http://www.childpsy.net/ http://think-israel.org http://americancensorship.org http://ffii.org http://memri.org http://jihadwatch.org http://pmw.org.il Live Lisp and prosper. ______________________________________________ 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.