I'm having an issue sourcing an R file from my workbench using StatET in the Eclipse IDE. All I'm trying to do is get comfortable with 'source' and run "source(C:/Program Files (x86)/Eclipse/eclipse/ProjectName/SourceFile.R)". When I try to call the path for the file i get the error: "unexpected '/' in "source(C:/". I've looked around but can't find any examples of sourcing from the C drive and can't tell what I'm doing wrong. Any help is greatly appreciated. -- View this message in context: http://r.789695.n4.nabble.com/Very-Basic-Source-Question-tp3769129p3769129.html Sent from the R help mailing list archive at Nabble.com.
Hi,
I think you misplaced the quotes. From ?source:
file: a connection or a character string giving the pathname of the
file or URL to read from. ‘""’ indicates the connection
‘stdin()’.
Try instead (untested):
source("C:/Program Files
(x86)/Eclipse/eclipse/ProjectName/SourceFile.R")
HTH,
Jorge
On Thu, Aug 25, 2011 at 2:57 PM, swonder03 <> wrote:
> I'm having an issue sourcing an R file from my workbench using StatET
in
> the
> Eclipse IDE. All I'm trying to do is get comfortable with
'source' and run
> "source(C:/Program Files
(x86)/Eclipse/eclipse/ProjectName/SourceFile.R)".
>
> When I try to call the path for the file i get the error: "unexpected
'/'
> in
> "source(C:/". I've looked around but can't find any
examples of sourcing
> from the C drive and can't tell what I'm doing wrong. Any help is
greatly
> appreciated.
>
> --
> View this message in context:
>
http://r.789695.n4.nabble.com/Very-Basic-Source-Question-tp3769129p3769129.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.
>
[[alternative HTML version deleted]]
>I'm trying to do is get comfortable with 'source' and run "source(C:/ProgramFiles (x86)/Eclipse/eclipse/ProjectName/SourceFile.R)". I'm not familiar with StatET/Eclipse IDE so this attempted answer might be way off mark. I'd be guessing it probably relates to quotation symbols in the correct location as shown here. source("mydir/directory with spaces/dir1/filename.r") This is because of the spaces in the directory names you find in windows. You could try a location on the C drive that doesn't have any spaces as part of your problem solving. Folders like "Program Files" and "Documents and Settings" can be handled properly though by R on windows, I'm just giving you a possible second step to think about. -- View this message in context: http://r.789695.n4.nabble.com/Very-Basic-Source-Question-tp3769129p3769343.html Sent from the R help mailing list archive at Nabble.com.