The error message is telling you that R cannot find your file. Is your 'motives_pc.dat' file in your R working directory? If not, you have to give a complete path to the scan() function.
Julian [EMAIL PROTECTED] wrote: > Dear helpers please provide me some helpful answer to my problem while I m > trying to run a program .I m attaching both the program and the data to > which I have to obtain my estimation results. > "Motives.dat" is the data file, and "OBTfile4.3" is the complete code of > program. by Running this > // > rawdata<-matrix(scan(inputFile, n = nsubj*ncomp), nsubj, ncomp, byrow = TRUE) > \\ > The error appears to be > // > Error in file(file, "r") : unable to open connection > In addition: Warning message: > cannot open file 'motives_pc.dat', reason 'No such file or directory' in: > file(file, "r") > \\ > where # name of preferences data file is assigned as, > inputFile <- "motives_pc.dat > Thanking Regards > > SYED ADIL HUSSAIN (+923455205402) > QUAID-E-AZAM UNIVERSITY > ISLAMABAD, PAKISTAN. > > This is Virus Free Email Scanned by QAU's McAfee Virus Scanner > ""THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY > MATERIAL > and is thus for use only by the intended recipient. If you received this in > error, please contact the sender and delete the e-mail > and its attachments from all computers." > www.qau.edu.pk > > > ------------------------------------------------------------------------ > > ______________________________________________ > 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. ______________________________________________ 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.