Hi if I use read.delim, I can specify how many lines I want to import. Is there also a way to specify that, e.g. I want only the first column field of each line to have imported? thanks for a hint cheers christoph
You can use colClasses; e.g.,> write.table(iris, file="iris.dat", sep="|", quote=FALSE, row=FALSE) > test <- read.delim("iris.dat", sep="|", header=TRUE, > colClass=c("numeric", rep("NULL", 4))) > head(test)Sepal.Length 1 5.1 2 4.9 3 4.7 4 4.6 5 5.0 6 5.4 Andy> From: Christoph Lehmann > > Hi > if I use read.delim, I can specify how many lines I want to import. > Is there also a way to specify that, e.g. I want only the > first column > field of each line to have imported? > > thanks for a hint > cheers > christoph > > ______________________________________________ > R-help at 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 > > >
?read.delim and see the colClasses argument. -Don At 3:53 PM +0200 4/15/05, Christoph Lehmann wrote:>Hi >if I use read.delim, I can specify how many lines I want to import. >Is there also a way to specify that, e.g. I want only the first >column field of each line to have imported? > >thanks for a hint >cheers >christoph > >______________________________________________ >R-help at 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-- -------------------------------------- Don MacQueen Environmental Protection Department Lawrence Livermore National Laboratory Livermore, CA, USA