Usually, along with that error message, you get a warning that gives a few details about the problem, like the name of the file and the reason it could be opened. E.g., > filename <- "no\\such\\file.blah.blah" > file(filename, "r", encoding="UTF-8") Error in file(filename, "r", encoding = "UTF-8") : cannot open the connection In addition: Warning message: In file(filename, "r", encoding = "UTF-8") : cannot open file 'no\such\file.blah.blah': No such file or directory Did you suppress warnings?
Bill Dunlap TIBCO Software wdunlap tibco.com On Thu, Jun 18, 2015 at 10:55 AM, Endy <pert...@yahoo.gr> wrote: > Hi, R users. > I am using windows 7 ultimate, as an OS, and the R version > 3.2.0. This combination creates some problems when I run R. The problem > focuses on the command ‘source’. > More precisely, suppose that we have a main function, let call it mainfn, > which > calls within it another function, call it subfn, with the command > source(“C:\\Program > Files\\. . .\\subfn.txt”). > The files with the R > code of the two functions, mainfn and subfn, are .txt files. First I load > the > mainfn function using File-> Source R code… and I get > >source(“C:\\Program Files\\ . . .\\mainfn.txt”) > Then I run the mainfn > >mainfn () > and I get > Error in file(filename, "r", encoding = encoding) > : > cannot open the > connection > Any suggestion what goes wrong? > > > > ______________________________________________ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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. [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.