unction via, e.g. (from R commandline)
>
> >> > source('./foo.r')
>
> >> or otherwise loaded, then called, e.g.
>
> >> > foo(bar='baz')
>
> >> ? I'm looking for the 'R equivalent' of how python supports this
>> I also wanted to point Tom to CRAN packages
>> getopt
>> optparse
>> written specifically to support command-line argument parsing with R
>
>Thanks, but again, I'm not seeing how those solve the given problem(s).
>Am I missing something?
The optparse package, tested with Rscript but pro
ter solution?
The author of getopt started but did not finish adding positional
arguments to ``getopt``. Howevor, positional arguments have been
supported in the ``optparse`` package for over a year if you specify
``positional_args=TRUE`` to the ``parse_args`` function.
- Trevor Davis
> Hi
>
> We've found that when using parse_args(..., positional_arguments=FALSE), it
> is permissible to invoke our script with either "--myfoo=bar" or "--myfoo
> bar"; that is, whether or not the equals sign is present makes no
> difference, and in fact both usage forms are demonstrated in the opt
On Wed, Feb 24, 2010 at 1:28 PM, Ryan Garner
wrote:
>
> I have a script that creates a qplot that is then saved as a .png file
> which
> works fine on Windows. But I also work on Linux servers via Putty and would
> like to be able to create and save my plots to my working directory. Is
> there a w
At least in the Unix version of the ``Rscript`` front-end to R (but
oddly enough not ``R CMD BATCH``) you could put something like this in
test.R:
cat("Save workspace image? [y/n]: ")
answer <- tolower( scan("stdin", "", n=1) )
if (substr(answer, 1, 1) == "y") {
q("yes")
} else {
q("no"
If you are using R in a *nix machine then R is usually compiled with
support for gnu-readline which does have a vi mode.
You need a file called ".inputrc" in your home directory containing the
following line:
set editing-mode vi
in order to activate it. It works exactly like the vi
There is also Grant Farnsworth's "Econometrics in R" in the contributed
documentation section of the R website:
http://cran.r-project.org/doc/contrib/Farnsworth-EconometricsInR.pdf
Best,
Trevor
Thiemo Fetzer wrote:
Dear Group,
I am an economics student starting with PhD work in London. As p
K. Elo wrote:
Hi,
Monica Pisica wrote:
> - There is no perfect “beginner” book.
How about
- Crawley, Michael (2007). The R book, Wiley & Sons.
- Maindonald, John & John Braun (2007): Data Analysis and Graphics Using
R (2nd edition), Cambridge University Press.
As a political scientist (with
9 matches
Mail list logo