From h.wickham at gmail.com  Tue Sep 24 17:39:56 2013
From: h.wickham at gmail.com (Hadley Wickham)
Date: Tue, 24 Sep 2013 10:39:56 -0500
Subject: [Rd] Capture output of install.packages (pipe system2)
In-Reply-To: <CABFfbXtv-7r6uupAaW7oMpiyOukv-GHns=qxqAEXFPBN8CCCsQ@mail.gmail.com>
References: <CABFfbXtWhc48KviWCQXR84xGywm1GU0oMWk1Vk7s0EqbcAfT5g@mail.gmail.com>
	<5240A280.1000804@gmail.com>
	<F165061B-F2DF-47CF-898F-920DC27C0DF7@r-project.org>
	<5240C5B8.4030301@gmail.com>
	<CABFfbXtv-7r6uupAaW7oMpiyOukv-GHns=qxqAEXFPBN8CCCsQ@mail.gmail.com>
Message-ID: <CABdHhvGwYBT-PST_fyD6+zms4RNCj_rSWjh24xhSuRa64-6APQ@mail.gmail.com>

You shouldn't assume - use file.path(R.home("bin"), "R")

Hadley

On Tue, Sep 24, 2013 at 9:37 AM, Jeroen Ooms <jeroen.ooms at stat.ucla.edu> wrote:
> On Mon, Sep 23, 2013 at 6:50 PM, Duncan Murdoch
> <murdoch.duncan at gmail.com> wrote:
>> x <- system2("Rscript", "-e \"install.packages('MASS',
>> repos='http://probability.ca/cran')\"", stdout=TRUE, stderr=TRUE)
>
> Thank you, this suggestion seems to work (although I agree that
> starting 3 procs to install a single package seems suboptimal). One
> additional question: is it safe to assume that the "Rscript"
> executable can always be found by the R process (cross platform), or
> do I need to modify the example in case Rscript is not in the system
> search path?
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



-- 
Chief Scientist, RStudio
http://had.co.nz/



[Rd] Capture output of install.packages (pipe system2)
Hadley Wickham