Silencing the output of install.packages()

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Silencing the output of install.packages()

Tejas Kale
Hello!

Is there a way to suppress the output of 'install.packages()'? I have
seen that the 'download.file' function has a 'quiet' option but I do
not know how to use it.

Thanks for your help

Tejas Kale
IUCAA, Pune

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Silencing the output of install.packages()

Uwe Ligges-3
On 31.05.2012 16:18, Tejas Kale wrote:
> Hello!
>
> Is there a way to suppress the output of 'install.packages()'? I have
> seen that the 'download.file' function has a 'quiet' option but I do
> not know how to use it.

I do not see any good reason to allow that. A user shoudl see if
software is being installed.

Uwe ligges



> Thanks for your help
>
> Tejas Kale
> IUCAA, Pune
>
> ______________________________________________
> [hidden email] 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.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Silencing the output of install.packages()

Tejas Kale
 Dear Uwe

Many thanks for your reply. I agree with you but I need the silencing of
output for a particular reason.

I am working on a statistical package called VOStat which uses a Java based
GUI to get the data and parameters of the test to be executed from the
user, creates the appropriate R script for it, runs it, and prints the
output given by R. For a particular test, if the required library is not
installed, the same is done dynamically without requiring any user input.
Now the problem I face is as follows:- Suppose the user requires a
correlation matrix of selected variables along with their p-values. For
this, I use the 'rcorr' function of the library 'Hmisc'. If the user does
not have 'Hmisc' available in his machine, it is automatically installed
for him. Once the installation is done, the library is loaded and 'rcorr'
is used for the necessary computation. But since I am presenting the entire
output generated by the R script (which has the install function as well),
along with the correlation matrices, the user of VOStat also gets to see
the output of 'install.packages()', something I want to avoid.

Could please suggest a workaround that could be used to get rid of the
output?

Thanks
Tejas



On Thursday 31 May 2012 08:00 PM, Uwe Ligges wrote:

On 31.05.2012 16:18, Tejas Kale wrote:

Hello!

Is there a way to suppress the output of 'install.packages()'? I have
seen that the 'download.file' function has a 'quiet' option but I do
not know how to use it.


I do not see any good reason to allow that. A user shoudl see if software
is being installed.

Uwe ligges



Thanks for your help

Tejas Kale
IUCAA, Pune

______________________________________________
[hidden email] 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]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Silencing the output of install.packages()

Uwe Ligges-3


On 01.06.2012 07:17, Tejas Kale wrote:

>   Dear Uwe
>
> Many thanks for your reply. I agree with you but I need the silencing of
> output for a particular reason.
>
> I am working on a statistical package called VOStat which uses a Java based
> GUI to get the data and parameters of the test to be executed from the
> user, creates the appropriate R script for it, runs it, and prints the
> output given by R. For a particular test, if the required library is not
> installed, the same is done dynamically without requiring any user input.
> Now the problem I face is as follows:- Suppose the user requires a
> correlation matrix of selected variables along with their p-values. For
> this, I use the 'rcorr' function of the library 'Hmisc'. If the user does
> not have 'Hmisc' available in his machine, it is automatically installed
> for him. Once the installation is done, the library is loaded and 'rcorr'
> is used for the necessary computation. But since I am presenting the entire
> output generated by the R script (which has the install function as well),
> along with the correlation matrices, the user of VOStat also gets to see
> the output of 'install.packages()', something I want to avoid.
>
> Could please suggest a workaround that could be used to get rid of the
> output?


You could try to sink() into some null device, if that does not interact
with the GUI you are using.

Best,
Uwe Ligges



> Thanks
> Tejas
>
>
>
> On Thursday 31 May 2012 08:00 PM, Uwe Ligges wrote:
>
> On 31.05.2012 16:18, Tejas Kale wrote:
>
> Hello!
>
> Is there a way to suppress the output of 'install.packages()'? I have
> seen that the 'download.file' function has a 'quiet' option but I do
> not know how to use it.
>
>
> I do not see any good reason to allow that. A user shoudl see if software
> is being installed.
>
> Uwe ligges
>
>
>
> Thanks for your help
>
> Tejas Kale
> IUCAA, Pune
>
> ______________________________________________
> [hidden email] 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.
>

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Silencing the output of install.packages()

Prof Brian Ripley
On 01/06/2012 08:46, Uwe Ligges wrote:

>
>
> On 01.06.2012 07:17, Tejas Kale wrote:
>> Dear Uwe
>>
>> Many thanks for your reply. I agree with you but I need the silencing of
>> output for a particular reason.
>>
>> I am working on a statistical package called VOStat which uses a Java
>> based
>> GUI to get the data and parameters of the test to be executed from the
>> user, creates the appropriate R script for it, runs it, and prints the
>> output given by R. For a particular test, if the required library is not
>> installed, the same is done dynamically without requiring any user input.
>> Now the problem I face is as follows:- Suppose the user requires a
>> correlation matrix of selected variables along with their p-values. For
>> this, I use the 'rcorr' function of the library 'Hmisc'. If the user does
>> not have 'Hmisc' available in his machine, it is automatically installed
>> for him. Once the installation is done, the library is loaded and 'rcorr'
>> is used for the necessary computation. But since I am presenting the
>> entire
>> output generated by the R script (which has the install function as
>> well),
>> along with the correlation matrices, the user of VOStat also gets to see
>> the output of 'install.packages()', something I want to avoid.
>>
>> Could please suggest a workaround that could be used to get rid of the
>> output?
>
>
> You could try to sink() into some null device, if that does not interact
> with the GUI you are using.

Unfortunately we don't know what platform the OP is talking about, as he
persistently ignores the posting guide.

With a source-package install there will be several processes involving
that are likely to write to stdout or stderr (the C file handles, not
the R connections), and sink() does not re-direct those.

I would expect sink() or capture.output() to work for a binary package
install (except for diagnostic messages which the user probably needs to
see: you can with case sink the R message connection).

> Best,
> Uwe Ligges
>
>
>
>> Thanks
>> Tejas
>>
>>
>>
>> On Thursday 31 May 2012 08:00 PM, Uwe Ligges wrote:
>>
>> On 31.05.2012 16:18, Tejas Kale wrote:
>>
>> Hello!
>>
>> Is there a way to suppress the output of 'install.packages()'? I have
>> seen that the 'download.file' function has a 'quiet' option but I do
>> not know how to use it.
>>
>>
>> I do not see any good reason to allow that. A user shoudl see if software
>> is being installed.

>>
>> Uwe ligges
>>
>>
>>
>> Thanks for your help
>>
>> Tejas Kale
>> IUCAA, Pune
>>
>> ______________________________________________
>> [hidden email] 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.
>>
>
> ______________________________________________
> [hidden email] 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.


--
Brian D. Ripley,                  [hidden email]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Silencing the output of install.packages()

craigcitro
In reply to this post by Uwe Ligges-3
>> Is there a way to suppress the output of 'install.packages()'? I have
>> seen that the 'download.file' function has a 'quiet' option but I do
>> not know how to use it.
>
> I do not see any good reason to allow that. A user should see if
> software is being installed.

Hi Uwe,

I have a proposed use-case. We run a series of unit tests in R, and want to plug them into various continuous build/test frameworks. Part of our system involves being able to install packages, so we need to actually run a unit test that uses `install.packages`. For better or worse, many of these depend on parsing the output of a test run; it's a lot of silly work to make them parse the additional `install.packages` output (as opposed to the much simpler `[\w]+: \.+` output from something like testthat in the case of success).

Two questions:
 * Is there another workaround? I'm planning on some ugly hackery on our side to deal with this, but would love something cleaner.
 * If I were willing to write the patch, would turning these statements into something we could suppress be acceptable for R?

Thanks!
-cc
Reply | Threaded
Open this post in threaded view
|

Re: Silencing the output of install.packages()

Michael Weylandt
On Thu, Jul 5, 2012 at 1:03 PM, craigcitro <[hidden email]> wrote:

>>> Is there a way to suppress the output of 'install.packages()'? I have
>>> seen that the 'download.file' function has a 'quiet' option but I do
>>> not know how to use it.
>>
>> I do not see any good reason to allow that. A user should see if
>> software is being installed.
>
> Hi Uwe,
>
> I have a proposed use-case. We run a series of unit tests in R, and want to
> plug them into various continuous build/test frameworks. Part of our system
> involves being able to install packages, so we need to actually run a unit
> test that uses `install.packages`. For better or worse, many of these depend
> on parsing the output of a test run; it's a lot of silly work to make them
> parse the additional `install.packages` output (as opposed to the much
> simpler `[\w]+: \.+` output from something like testthat in the case of
> success).
>
> Two questions:
>  * Is there another workaround? I'm planning on some ugly hackery on our
> side to deal with this, but would love something cleaner.
>  * If I were willing to write the patch, would turning these statements into
> something we could suppress be acceptable for R?

I think this has already been done in r59493ff of the svn repos by the
indefatigable Prof. Ripley

Best,
Michael

>
> Thanks!
> -cc
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Silencing-the-output-of-install-packages-tp4631947p4635525.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> [hidden email] 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.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Silencing the output of install.packages()

craigcitro
> I think this has already been done in r59493ff of the svn repos by the
> indefatigable Prof. Ripley
>

Fantastic. I guess it *is* true: the first step in writing any patch
for R is to first ask yourself if Brian Ripley has already made the
change since the last release.

Thanks Brian!

--

-cc

______________________________________________
[hidden email] 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.