Hello, I'm new to R and in the process of testing it My first question: I fail to read in my data (ANSI toto.txt file, tab separated) > test <-read.table("toto.txt") Error in file(file, "r") : unable to open connection In addition: Warning message: cannot open file `toto.txt' > test <- scan("C:\\toto.txt") Error in scan("C:\\toto.txt") : "scan" expected a real, got "No_D" > test <-scan("test.dat") Error in file(file, "r") : unable to open connection In addition: Warning message: cannot open file `toto.txt (and no, it is not read only or locked or whatever) I use Windows 2000/XP second question...what are the size limits of statistical files I can handle? I plan to analize plant datas (up to 500'000 records, from which I will analize a restrictive set of variates ) Even when broken down by some chracteristics, the data to analize can have 50'000-100'000 records Well thank for the help Anne [[alternative HTML version deleted]]
You probably need to change the directory to the one that contains the text file you are reading in. This is done under the File menu. Jim James W. MacDonald Affymetrix and cDNA Microarray Core University of Michigan Cancer Center 1500 E. Medical Center Drive 7410 CCGC Ann Arbor MI 48109 734-647-5623>>> "Anne Piotet" <Anne.Olga.Piotet at omsv.vd.ch> 08/15/03 10:42AM >>>Hello, I'm new to R and in the process of testing it My first question: I fail to read in my data (ANSI toto.txt file, tab separated) > test <-read.table("toto.txt") Error in file(file, "r") : unable to open connection In addition: Warning message: cannot open file `toto.txt' > test <- scan("C:\\toto.txt") Error in scan("C:\\toto.txt") : "scan" expected a real, got "No_D" > test <-scan("test.dat") Error in file(file, "r") : unable to open connection In addition: Warning message: cannot open file `toto.txt (and no, it is not read only or locked or whatever) I use Windows 2000/XP second question...what are the size limits of statistical files I can handle? I plan to analize plant datas (up to 500'000 records, from which I will analize a restrictive set of variates ) Even when broken down by some chracteristics, the data to analize can have 50'000-100'000 records Well thank for the help Anne [[alternative HTML version deleted]] ______________________________________________ R-help at stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>>>>> "AP" == Anne Piotet <Anne.Olga.Piotet at omsv.vd.ch> disait:AP> Hello, I'm new to R and in the process of testing it My first AP> question: I fail to read in my data (ANSI toto.txt file, tab AP> separated) >> test <-read.table("toto.txt") AP> Error in file(file, "r") : unable to open AP> connection In addition: Warning message: cannot open file AP> `toto.txt' >> test <- scan("C:\\toto.txt") AP> Error in scan("C:\\toto.txt") : "scan" expected a AP> real, got "No_D" >> test <-scan("test.dat") AP> Error in file(file, "r") : unable to open AP> connection In addition: Warning message: cannot open file AP> `toto.txt (and no, it is not read only or locked or whatever) AP> I use Windows 2000/XP I think read.table("C:\\toto.txt",header=TRUE) will do the job : the message you got on your first and third attempts means that you gave a wrong path to your file. otherwise, read the help for read.table carefully (header and skip parameters). AP> second question...what are the size limits of statistical AP> files I can handle? I plan to analize plant datas (up to AP> 500'000 records, from which I will analize a restrictive set AP> of variates ) Even when broken down by some chracteristics, AP> the data to analize can have 50'000-100'000 records AP> Well thank for the help Anne de rien ;) regards, --Mathieu
Anne Piotet wrote:> Hello, > I'm new to R and in the process of testing it > My first question: I fail to read in my data (ANSI toto.txt file, tab separated) > > test <-read.table("toto.txt") > Error in file(file, "r") : unable to open connection > In addition: Warning message: > cannot open file `toto.txt'- that's because it didnt find the file in that location.> > test <- scan("C:\\toto.txt") > Error in scan("C:\\toto.txt") : "scan" expected a real, got "No_D"- that's because it did find the file, but there was the text "No_D" in it. scan() will only read numbers unless you tell it otherwise.> > test <-scan("test.dat") > Error in file(file, "r") : unable to open connection > In addition: Warning message: > cannot open file `toto.txtagain, its not looking in c:\, so it doesn't find it. Funny how scan("test.dat") brings up an error about "toto.txt" :) R has a working directory which is where scan() and read.file() will start looking for files without a full path - type getwd() to see where that is at any time. You didnt try the other option: test <- read.table("c:\\toto.txt", sep='\t') - I give a full path to toto.txt and tell it the columns are separated with tabs ('\t'). You may need other options - popular ones are as.is=T which keeps character variables as text rather than converting to categorical data (factors), and head=T if the first line of the file is a header with column names. If this works, then do names(test) and summary(test) to see what you've got.> second question...what are the size limits of statistical files I can handle? I plan to analize plant datas (up to 500'000 records, from which I will analize a restrictive set of variates ) Even when broken down by some chracteristics, the data to analize can have 50'000-100'000 recordsDepends - whats the size of the machine you are using (and dont say its a small box that fits under my monitor). How much RAM and disk space does it have? Baz