> 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