[R] Command line arguments with source() - Windows OS

Wacek Kusnierczyk Waclaw.Marcin.Kusnierczyk at idi.ntnu.no
Tue Nov 18 10:09:44 CET 2008


Wacek Kusnierczyk wrote:
> Duncan Murdoch wrote:
>   
>> paramValue <- 15
>> source("myRfile.R")
>>
>> The quotes are necessary, because source(myRfile.R) would go looking
>> for a variable named myRfile.R, rather than using "myRfile.R" as the
>> filename.
>>     
>
> why?

i see this question has been ignored, but i was quite serious.  the
question was not technical ("how does it happen that source(file) will
look up a variable called 'file' rather than open a file called
'file'?") but rather about the design ("why do some functions, e.g.,
source, require a character string, while others deparse the expression
and can take an unquoted variable name?").  that is, what is the
criterion you use to decide that myfancynewfunction(argument) should
behave one or the other way?  is the criterion documented anywhere, or
is it just i-wish-so that decides in each single case?

vQ



More information about the R-help mailing list