[R] using cat()

[Ricardo Rodriguez] Your XEN ICT Team webmaster at xen.net
Fri Aug 7 08:28:12 CEST 2009


Thanks, Bill

Bill.Venables at csiro.au wrote:
> fn <- function(x) {
> 	j <- x+1
> 	cat("the value of j is ", j, "\n")
> 	j
>  }
>
> fn(1:10)

It is clear for me now the use of cat(). As Steve pointed out in his 
mail, I've failed at providing an example, one of the rules of thumb of 
this list! Sorry about that. Also as Steve says, I am trying to use 
cat() for something it's not meant to do. I am trying to pull out the 
value of a variable, well, some variables, without making them global by 
using <<-

Following your example, I was guessing if something like fn.j could be used.

Cheers,

Ricardo

-- 
Ricardo Rodríguez
Your XEN ICT Team




More information about the R-help mailing list