Thanks so much, Phil!
On Fri, Sep 24, 2010 at 2:45 PM, Phil Spector <spec...@stat.berkeley.edu>wrote: > Changbin - > If you want the entire line, use > > readLines('~/ca_boost_feature.txt',warn=FALSE)[2] >> > [1] " H.2.C C.1.D C.3.R E.0.N C.2.S C.0.G H.3.G" > > If you want a vector with the contents of the line, use > > scan('~/ca_boost_feature.txt',skip=1,n=7,what='') >> > Read 7 items > [1] "H.2.C" "C.1.D" "C.3.R" "E.0.N" "C.2.S" "C.0.G" "H.3.G" > > Hope this helps. > - Phil Spector > Statistical Computing Facility > Department of Statistics > UC Berkeley > spec...@stat.berkeley.edu > > > > > > > On Fri, 24 Sep 2010, Changbin Du wrote: > > Dear community, >> >> I have one file named ca_boost_feature.txt, >> >> Feature selection (Boosting:0.0025,5)! >> H.2.C C.1.D C.3.R E.0.N C.2.S C.0.G H.3.G >> log file: ep >> >> If I want to use the second line of this file, how to read it into R? >> >> varr<-read.table("/home/cdu/operon/carbonic/ca_boost_feature.txt", sep=" >> ", >> skip=1, header=F, strip.white=TRUE, nrows=1) >> Warning message: >> In read.table("/home/cdu/operon/carbonic/ca_boost_feature.txt", : >> incomplete final line found by readTableHeader on >> '/home/cdu/operon/carbonic/ca_boost_feature.txt' >> >> I attached this file with this email. >> >> Thanks! >> >> >> -- >> Sincerely, >> Changbin >> -- >> >> -- Sincerely, Changbin -- Changbin Du DOE Joint Genome Institute Bldg 400 Rm 457 2800 Mitchell Dr Walnut Creet, CA 94598 Phone: 925-927-2856 [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org 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.