Re: [R] read csv

From: Thomas Hunger <hto_at_arcor.de>
Date: Mon 04 Sep 2006 - 17:42:34 GMT

> 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. Received on Tue Sep 05 03:45:54 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 07 Sep 2006 - 07:51:18 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.