> I have a csv file where the number of filled columns > varies in the different rows:
I would hack it like this, but then I am totally new to R, which means you should not trust me.: d <- read.csv("testdata", header=F) selection <- apply(d, c(1), function(x) {sum(!is.na(x) & x != "") > 2}) as.data.frame(t(as.data.frame(t(d))[selection])) Tom ______________________________________________ R-help@stat.math.ethz.ch 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.