Jeff Newmiller
2018-Oct-27 02:42 UTC
[R] source() fails in same directory as script: cannot find file
I haven't seen mention of what OS or filesystem types are involved, but it superficially looks like it might be one of those cases where the filesystem is case-sensitive... check that all your directory and file names are capitalized correctly. On October 26, 2018 1:11:19 PM PDT, Jeremie Juste <jeremiejuste at gmail.com> wrote:>Hello, > >I suspect the error is in the file input-summerize.R. > >I creating a new file input-summerize2.R with only print("hello") for >instance and check if > >> >setwd("~/documents/white-papers/geochemistry/willamette-river-mercury/scripts") >> source("input-summerize2.R") > >works > >Hope it helps, > >Jeremie > > >Rich Shepard <rshepard at appl-ecosys.com> writes: > >> On Fri, 26 Oct 2018, Ista Zahn wrote: >> >>> I'm confused. It seems the error is that the file can't be found; if >>> so, what does it matter what is in the file? >> >> Ista, >> >> Beats me. >> >>> As far as I can see you are either not in the directory you think >you >>> are, or b) the file is not named what you think it is. >> >> Yes, the error seems that R cannot find the file, but it's in the >same >> directory and the file does exist: >> >>> getwd() >> [1] >"/home/rshepard/documents/white-papers/geochemistry/willamette-river-mercury/scripts" >> >> >~/documents/white-papers/geochemistry/willamette-river-mercury/scripts]$ >ls input-summerize.R >> input-summerize.R >> >> So, R is running in the scripts/ directory and the script is there, >too. >> >> This is why I asked for help as the error makes no sense to me. >> >> Regards, >> >> Rich >> >> ______________________________________________ >> R-help at 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. > >______________________________________________ >R-help at 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.-- Sent from my phone. Please excuse my brevity.
Ista Zahn
2018-Oct-27 13:35 UTC
[R] source() fails in same directory as script: cannot find file
On Fri, Oct 26, 2018 at 10:42 PM Jeff Newmiller <jdnewmil at dcn.davis.ca.us> wrote:> > I haven't seen mention of what OS or filesystem types are involved, but it superficially looks like it might be one of those cases where the filesystem is case-sensitive... check that all your directory and file names are capitalized correctly.Just out of curiosity -- are my messages to r-help not going through? I correctly diagnosed the problem as a simple typo in my message on Oct 26 at 2:54 PM, but then the discussion just continued as if that never happened.> > On October 26, 2018 1:11:19 PM PDT, Jeremie Juste <jeremiejuste at gmail.com> wrote: > >Hello, > > > >I suspect the error is in the file input-summerize.R. > > > >I creating a new file input-summerize2.R with only print("hello") for > >instance and check if > > > >> > >setwd("~/documents/white-papers/geochemistry/willamette-river-mercury/scripts") > >> source("input-summerize2.R") > > > >works > > > >Hope it helps, > > > >Jeremie > > > > > >Rich Shepard <rshepard at appl-ecosys.com> writes: > > > >> On Fri, 26 Oct 2018, Ista Zahn wrote: > >> > >>> I'm confused. It seems the error is that the file can't be found; if > >>> so, what does it matter what is in the file? > >> > >> Ista, > >> > >> Beats me. > >> > >>> As far as I can see you are either not in the directory you think > >you > >>> are, or b) the file is not named what you think it is. > >> > >> Yes, the error seems that R cannot find the file, but it's in the > >same > >> directory and the file does exist: > >> > >>> getwd() > >> [1] > >"/home/rshepard/documents/white-papers/geochemistry/willamette-river-mercury/scripts" > >> > >> > >~/documents/white-papers/geochemistry/willamette-river-mercury/scripts]$ > >ls input-summerize.R > >> input-summerize.R > >> > >> So, R is running in the scripts/ directory and the script is there, > >too. > >> > >> This is why I asked for help as the error makes no sense to me. > >> > >> Regards, > >> > >> Rich > >> > >> ______________________________________________ > >> R-help at 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. > > > >______________________________________________ > >R-help at 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. > > -- > Sent from my phone. Please excuse my brevity. > > ______________________________________________ > R-help at 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.
Bert Gunter
2018-Oct-27 14:18 UTC
[R] source() fails in same directory as script: cannot find file
Your messages got through fine (to me, anyway). I suspect people are just failing to read through the threads. -- Bert On Sat, Oct 27, 2018 at 6:35 AM Ista Zahn <istazahn at gmail.com> wrote:> On Fri, Oct 26, 2018 at 10:42 PM Jeff Newmiller > <jdnewmil at dcn.davis.ca.us> wrote: > > > > I haven't seen mention of what OS or filesystem types are involved, but > it superficially looks like it might be one of those cases where the > filesystem is case-sensitive... check that all your directory and file > names are capitalized correctly. > > Just out of curiosity -- are my messages to r-help not going through? > I correctly diagnosed the problem as a simple typo in my message on > Oct 26 at 2:54 PM, but then the discussion just continued as if that > never happened. > > > > > On October 26, 2018 1:11:19 PM PDT, Jeremie Juste < > jeremiejuste at gmail.com> wrote: > > >Hello, > > > > > >I suspect the error is in the file input-summerize.R. > > > > > >I creating a new file input-summerize2.R with only print("hello") for > > >instance and check if > > > > > >> > > > >setwd("~/documents/white-papers/geochemistry/willamette-river-mercury/scripts") > > >> source("input-summerize2.R") > > > > > >works > > > > > >Hope it helps, > > > > > >Jeremie > > > > > > > > >Rich Shepard <rshepard at appl-ecosys.com> writes: > > > > > >> On Fri, 26 Oct 2018, Ista Zahn wrote: > > >> > > >>> I'm confused. It seems the error is that the file can't be found; if > > >>> so, what does it matter what is in the file? > > >> > > >> Ista, > > >> > > >> Beats me. > > >> > > >>> As far as I can see you are either not in the directory you think > > >you > > >>> are, or b) the file is not named what you think it is. > > >> > > >> Yes, the error seems that R cannot find the file, but it's in the > > >same > > >> directory and the file does exist: > > >> > > >>> getwd() > > >> [1] > > > >"/home/rshepard/documents/white-papers/geochemistry/willamette-river-mercury/scripts" > > >> > > >> > > >~/documents/white-papers/geochemistry/willamette-river-mercury/scripts]$ > > >ls input-summerize.R > > >> input-summerize.R > > >> > > >> So, R is running in the scripts/ directory and the script is there, > > >too. > > >> > > >> This is why I asked for help as the error makes no sense to me. > > >> > > >> Regards, > > >> > > >> Rich > > >> > > >> ______________________________________________ > > >> R-help at 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. > > > > > >______________________________________________ > > >R-help at 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. > > > > -- > > Sent from my phone. Please excuse my brevity. > > > > ______________________________________________ > > R-help at 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. > > ______________________________________________ > R-help at 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]]
Rich Shepard
2018-Oct-27 14:37 UTC
[R] source() fails in same directory as script: cannot find file
On Sat, 27 Oct 2018, Ista Zahn wrote:> Just out of curiosity -- are my messages to r-help not going through? I > correctly diagnosed the problem as a simple typo in my message on Oct 26 > at 2:54 PM, but then the discussion just continued as if that never > happened.I responded to you and Jeff (his off the list), and saw my response to you yesterday. Since you found the typo I keep missing, and I fixed it, I deleted the thread here. Rich
Duncan Murdoch
2018-Oct-27 20:38 UTC
[R] source() fails in same directory as script: cannot find file
On 27/10/2018 9:35 AM, Ista Zahn wrote:> On Fri, Oct 26, 2018 at 10:42 PM Jeff Newmiller > <jdnewmil at dcn.davis.ca.us> wrote: >> >> I haven't seen mention of what OS or filesystem types are involved, but it superficially looks like it might be one of those cases where the filesystem is case-sensitive... check that all your directory and file names are capitalized correctly. > > Just out of curiosity -- are my messages to r-help not going through? > I correctly diagnosed the problem as a simple typo in my message on > Oct 26 at 2:54 PM, but then the discussion just continued as if that > never happened.I saw it. I don't know why others didn't.... Duncan Murdoch> >> >> On October 26, 2018 1:11:19 PM PDT, Jeremie Juste <jeremiejuste at gmail.com> wrote: >>> Hello, >>> >>> I suspect the error is in the file input-summerize.R. >>> >>> I creating a new file input-summerize2.R with only print("hello") for >>> instance and check if >>> >>>> >>> setwd("~/documents/white-papers/geochemistry/willamette-river-mercury/scripts") >>>> source("input-summerize2.R") >>> >>> works >>> >>> Hope it helps, >>> >>> Jeremie >>> >>> >>> Rich Shepard <rshepard at appl-ecosys.com> writes: >>> >>>> On Fri, 26 Oct 2018, Ista Zahn wrote: >>>> >>>>> I'm confused. It seems the error is that the file can't be found; if >>>>> so, what does it matter what is in the file? >>>> >>>> Ista, >>>> >>>> Beats me. >>>> >>>>> As far as I can see you are either not in the directory you think >>> you >>>>> are, or b) the file is not named what you think it is. >>>> >>>> Yes, the error seems that R cannot find the file, but it's in the >>> same >>>> directory and the file does exist: >>>> >>>>> getwd() >>>> [1] >>> "/home/rshepard/documents/white-papers/geochemistry/willamette-river-mercury/scripts" >>>> >>>> >>> ~/documents/white-papers/geochemistry/willamette-river-mercury/scripts]$ >>> ls input-summerize.R >>>> input-summerize.R >>>> >>>> So, R is running in the scripts/ directory and the script is there, >>> too. >>>> >>>> This is why I asked for help as the error makes no sense to me. >>>> >>>> Regards, >>>> >>>> Rich >>>> >>>> ______________________________________________ >>>> R-help at 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. >>> >>> ______________________________________________ >>> R-help at 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. >> >> -- >> Sent from my phone. Please excuse my brevity. >> >> ______________________________________________ >> R-help at 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. > > ______________________________________________ > R-help at 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. >