Dear Phil, Thanks for your reply. I tried using: But this message appears: Error in scale(newdata[, object$scaled, drop = FALSE], center = object$x.scale$"scaled:center", : (subscript) logical subscript too long I also changed the separator but did not solve the problem many thanks, Nancy
> Date: Tue, 15 Dec 2009 14:05:14 -0800 > From: spec...@stat.berkeley.edu > To: nancyada...@hotmail.com > CC: r-help@r-project.org > Subject: Re: [R] read dataset in R language. > > Nancy - > The separator in these files is the comma, not the semicolon. > Try > > train = read.csv('trainingset.txt',check.names=FALSE) > test = read.csv('testset.txt',check.names=FALSE) > > - Phil Spector > Statistical Computing Facility > Department of Statistics > UC Berkeley > spec...@stat.berkeley.edu > > > > On Tue, 15 Dec 2009, Nancy Adam wrote: > > > > > > > Hi all,Thanks for your reply. Sorry I did not send sufficient information > > about my problem I attach the two datasets that Im trying to read and > > these are my attempts to read them:1)#train <- > > read.table("trainingset.txt", header=TRUE, sep=";" ,fill=TRUE) #test <- > > read.table("testset.txt", header=TRUE, sep=";" , fill=TRUE)its error > > message is: > > undefined columns selected2)train <- scan("trainingset.txt", sep=";" > > ,fill=TRUE) test <- scan("testset.txt", sep=";" , fill=TRUE) > > > > its error message is: > > 'names' attribute [172] must be the same length as the vector [152] > > > > many thanks, > > Nancy > > _________________________________________________________________ > > > > _________________________________________________________________ Keep your friends updatedeven when youre not signed in. [[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.