Re: [R] loading packages in a function

2012-02-09 Thread Arnaud Gaboury
Ah, I feel stupid!

OK, it works for me.

TY for your help

Arnaud Gaboury
 
A2CT2 Ltd.


-Original Message-
From: Sarah Goslee [mailto:sarah.gos...@gmail.com] 
Sent: jeudi 9 février 2012 20:02
To: Arnaud Gaboury
Cc: r-help@r-project.org
Subject: Re: [R] loading packages in a function

That's because you're loading the packages twice, once suppressing the messages 
and once not.

You only need the first pair of lines.

On Thu, Feb 9, 2012 at 1:55 PM, Arnaud Gaboury  wrote:
> TY for your answer, but here what i did :
>
> #load needed lybrary
> suppressPackageStartupMessages(library(plyr))
> suppressPackageStartupMessages(library(car))
> library(plyr)
> library(car)
>
>
> But I still get :
>
> Loading required package: MASS
> Loading required package: nnet
>
>
> Arnaud Gaboury
>
> A2CT2 Ltd.
>
>
> -Original Message-
> From: R. Michael Weylandt [mailto:michael.weyla...@gmail.com]
> Sent: jeudi 9 février 2012 19:26
> To: Arnaud Gaboury
> Cc: r-help@r-project.org
> Subject: Re: [R] loading packages in a function
>
> Perhaps the longest function in base R I know of:
>
> suppressPackageStartupMessages
>
> e.g.,
>
> suppressPackageStartupMessages(library(zoo))
>
> Michael
>
> On Thu, Feb 9, 2012 at 12:44 PM, Arnaud Gaboury  
> wrote:
>> Hello,
>>
>> I sourced successfully my function().
>>
>> I need to load libraries, so I wrote this inside my function():
>>
>> function()
>>
>> {
>>
>> #load needed library
>> library(plyr)
>> library(car)
>>
>> /...
>>
>> }
>>
>> It is OK, but I have this on my invite command when running the function:
>>
>>> function()
>> Loading required package: MASS
>> Loading required package: nnet
>> YOU DID A GOOD JOB,SEND EMAIL
>>
>> Last line is the supposed result of my function, so it ok.
>>
>>
>> How to get rid of the first two lines, only for esthetic purpose?
>>
>> TY for your time.
>>
>>
>> Arnaud Gaboury
>>


--
Sarah Goslee
http://www.functionaldiversity.org

__
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.


Re: [R] loading packages in a function

2012-02-09 Thread Sarah Goslee
That's because you're loading the packages twice,
once suppressing the messages and once not.

You only need the first pair of lines.

On Thu, Feb 9, 2012 at 1:55 PM, Arnaud Gaboury  wrote:
> TY for your answer, but here what i did :
>
> #load needed lybrary
> suppressPackageStartupMessages(library(plyr))
> suppressPackageStartupMessages(library(car))
> library(plyr)
> library(car)
>
>
> But I still get :
>
> Loading required package: MASS
> Loading required package: nnet
>
>
> Arnaud Gaboury
>
> A2CT2 Ltd.
>
>
> -Original Message-
> From: R. Michael Weylandt [mailto:michael.weyla...@gmail.com]
> Sent: jeudi 9 février 2012 19:26
> To: Arnaud Gaboury
> Cc: r-help@r-project.org
> Subject: Re: [R] loading packages in a function
>
> Perhaps the longest function in base R I know of:
>
> suppressPackageStartupMessages
>
> e.g.,
>
> suppressPackageStartupMessages(library(zoo))
>
> Michael
>
> On Thu, Feb 9, 2012 at 12:44 PM, Arnaud Gaboury  
> wrote:
>> Hello,
>>
>> I sourced successfully my function().
>>
>> I need to load libraries, so I wrote this inside my function():
>>
>> function()
>>
>> {
>>
>> #load needed library
>> library(plyr)
>> library(car)
>>
>> /...
>>
>> }
>>
>> It is OK, but I have this on my invite command when running the function:
>>
>>> function()
>> Loading required package: MASS
>> Loading required package: nnet
>> YOU DID A GOOD JOB,SEND EMAIL
>>
>> Last line is the supposed result of my function, so it ok.
>>
>>
>> How to get rid of the first two lines, only for esthetic purpose?
>>
>> TY for your time.
>>
>>
>> Arnaud Gaboury
>>


-- 
Sarah Goslee
http://www.functionaldiversity.org

__
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.


Re: [R] loading packages in a function

2012-02-09 Thread Arnaud Gaboury
TY for your answer, but here what i did :

#load needed lybrary
suppressPackageStartupMessages(library(plyr))
suppressPackageStartupMessages(library(car))
library(plyr)
library(car)


But I still get :

Loading required package: MASS
Loading required package: nnet


Arnaud Gaboury
 
A2CT2 Ltd.


-Original Message-
From: R. Michael Weylandt [mailto:michael.weyla...@gmail.com] 
Sent: jeudi 9 février 2012 19:26
To: Arnaud Gaboury
Cc: r-help@r-project.org
Subject: Re: [R] loading packages in a function

Perhaps the longest function in base R I know of:

suppressPackageStartupMessages

e.g.,

suppressPackageStartupMessages(library(zoo))

Michael

On Thu, Feb 9, 2012 at 12:44 PM, Arnaud Gaboury  
wrote:
> Hello,
>
> I sourced successfully my function().
>
> I need to load libraries, so I wrote this inside my function():
>
> function()
>
> {
>
> #load needed library
> library(plyr)
> library(car)
>
> /...
>
> }
>
> It is OK, but I have this on my invite command when running the function:
>
>> function()
> Loading required package: MASS
> Loading required package: nnet
> YOU DID A GOOD JOB,SEND EMAIL
>
> Last line is the supposed result of my function, so it ok.
>
>
> How to get rid of the first two lines, only for esthetic purpose?
>
> TY for your time.
>
>
> Arnaud Gaboury
>
> A2CT2 Ltd.
>
> __
> 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.

__
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.


Re: [R] loading packages in a function

2012-02-09 Thread R. Michael Weylandt
Perhaps the longest function in base R I know of:

suppressPackageStartupMessages

e.g.,

suppressPackageStartupMessages(library(zoo))

Michael

On Thu, Feb 9, 2012 at 12:44 PM, Arnaud Gaboury
 wrote:
> Hello,
>
> I sourced successfully my function().
>
> I need to load libraries, so I wrote this inside my function():
>
> function()
>
> {
>
> #load needed library
> library(plyr)
> library(car)
>
> /...
>
> }
>
> It is OK, but I have this on my invite command when running the function:
>
>> function()
> Loading required package: MASS
> Loading required package: nnet
> YOU DID A GOOD JOB,SEND EMAIL
>
> Last line is the supposed result of my function, so it ok.
>
>
> How to get rid of the first two lines, only for esthetic purpose?
>
> TY for your time.
>
>
> Arnaud Gaboury
>
> A2CT2 Ltd.
>
> __
> 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.

__
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.