How to load comma separated data into R?
问题 I have a flat file like this: x1, x2, x3, x4, x5 0.438,0.498,3.625,3.645,5.000 2.918,5.000,2.351,2.332,2.643 1.698,1.687,1.698,1.717,1.744 0.593,0.502,0.493,0.504,0.445 0.431,0.444,0.440,0.429,1.0 0.438,0.498,3.625,3.648,5.000 How do I load it in R. I have tried to do this > x <- read.table("C:\\flatFile.txt", header=TRUE) but after I do some operation I get error like > colSums(x) Error in colSums(x) : 'x' must be numeric 回答1: If you look at the help on read.table you'll discover some extra