[R] Turning of source echo

Berend Hasselman bhh at xs4all.nl
Sat Aug 25 21:45:30 CEST 2012


On 25-08-2012, at 17:59, darnold wrote:

> Noia,
> 
> Nope. Although sep is helpful for my output, I still get that source echo
> that I want to suppress. Here is the code with Noia's suggestion.
> 
> 
> BAGA <- c(10,20,20,30,30,30,30,40,
>          40,40,40,50,50,50,50,50,
>          60,60,60,60,60,70,70,70,
>          70,80,80,80,90,90,100)
> 
> BAGB <- c(10,10,10,10,10,20,20,20,
>           20,30,30,30,40,40,50,60,
>           70,70,80,80,80,90,90,90,
>           90,100,100,100,100,100)
> 
> A <- sample(c(1,2),1)
> 
> if (A==1) {
>  B <- BAGA[sample(length(BAGA),1)]
> } else {
>  B <- BAGB[sample(length(BAGB),1)]
> }
> 
> cat("X = ", B, sep="")
> 
> And the output:
> 
>> source('~/Documents/classes/trunk/math15/resources/TIFiles/todd.R')
> X = 60
> 
> I want to suppress that source echo.

From your formulation it is not clear what you don't want.
I assume you don't want to see the line with the source function call.
I don't think this will be possible.

You should ask this question on the RStudio forums.

Berend




More information about the R-help mailing list