Hi all, I created a file to define some functions. When I try to source this file, sometimes it works but sometimes I get the following error:>Source(‘File.R’)Error in srcfilecopy(filename, lines, file.info(filename)[1, "mtime"]) : unused argument(s) (file.info(filename)[1, "mtime"]) It works when I just started the R session, but after using some libraries when I do the source of the file again, I get this error. I can not really follow what steps aret he ones that bring me to the error, I only know that sometimes it appears. Does someone know the possible cause? Thanks! Marta [[alternative HTML version deleted]]
Is the file just definitions of functions, or do you have some statements that are being executed? Could the error be coming from them? Just defining functions should work just fine. On Fri, May 25, 2012 at 10:08 AM, Marta Tol?s <marta.tolos at gtd.es> wrote:> Hi all, > > > > I created a file to define some functions. When I try to source this file, > sometimes it works but sometimes I get the following error: > > > >>Source(?File.R?) > > > > Error in srcfilecopy(filename, lines, file.info(filename)[1, "mtime"]) : > > ?unused argument(s) (file.info(filename)[1, "mtime"]) > > > > It works when I just started the R session, but after using some libraries > when I do the source of the file again, I get this error. I can not really > follow what steps aret he ones that bring me to the error, I only know that > sometimes it appears. Does someone know the possible cause? > > > > Thanks! > > Marta > > > ? ? ? ?[[alternative HTML version deleted]] > > > ______________________________________________ > R-help at 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. >-- Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it.
Hi, Try source("File.R") A.K. ----- Original Message ----- From: Marta Tol?s <marta.tolos at gtd.es> To: r-help at r-project.org Cc: Sent: Friday, May 25, 2012 10:08 AM Subject: [R] Problem sourcing file Hi all, I created a file to define some functions. When I try to source this file, sometimes it works but sometimes I get the following error:>Source(?File.R?)Error in srcfilecopy(filename, lines, file.info(filename)[1, "mtime"]) : ? unused argument(s) (file.info(filename)[1, "mtime"]) It works when I just started the R session, but after using some libraries when I do the source of the file again, I get this error. I can not really follow what steps aret he ones that bring me to the error, I only know that sometimes it appears. Does someone know the possible cause? Thanks! Marta ??? [[alternative HTML version deleted]] ______________________________________________ R-help at 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.
It does not have anything to do with the sourcing. Rather, it lies in the code that is in your File.R, which is not given here. --------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --------------------------------------------------------------------------- Sent from my phone. Please excuse my brevity. arun <smartpink111 at yahoo.com> wrote:>Hi, > >Try > >source("File.R") > >A.K. > >----- Original Message ----- >From: Marta Tol?s <marta.tolos at gtd.es> >To: r-help at r-project.org >Cc: >Sent: Friday, May 25, 2012 10:08 AM >Subject: [R] Problem sourcing file > >Hi all, > > > >I created a file to define some functions. When I try to source this >file, >sometimes it works but sometimes I get the following error: > > > >>Source(?File.R?) > > > >Error in srcfilecopy(filename, lines, file.info(filename)[1, "mtime"]) >: > >? unused argument(s) (file.info(filename)[1, "mtime"]) > > > >It works when I just started the R session, but after using some >libraries >when I do the source of the file again, I get this error. I can not >really >follow what steps aret he ones that bring me to the error, I only know >that >sometimes it appears. Does someone know the possible cause? > > > >Thanks! > >Marta > > >??? [[alternative HTML version deleted]] > > >______________________________________________ >R-help at 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 at 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.
On 25/05/2012 10:08 AM, Marta Tol?s wrote:> Hi all, > > > > I created a file to define some functions. When I try to source this file, > sometimes it works but sometimes I get the following error: > > > > >Source(?File.R?)Those aren't proper quotes, and source() shouldn't be capitalized, and you didn't tell us what version of R you are using. Duncan Murdoch> > > > Error in srcfilecopy(filename, lines, file.info(filename)[1, "mtime"]) : > > unused argument(s) (file.info(filename)[1, "mtime"]) > > > > It works when I just started the R session, but after using some libraries > when I do the source of the file again, I get this error. I can not really > follow what steps aret he ones that bring me to the error, I only know that > sometimes it appears. Does someone know the possible cause? > > > > Thanks! > > Marta > > > [[alternative HTML version deleted]] > > > > ______________________________________________ > R-help at 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.