Re: [R] sink() within a function?

From: Duncan Murdoch <murdoch_at_stats.uwo.ca>
Date: Thu 02 Jun 2005 - 03:22:42 EST

Jon Stearley wrote:
> On Jun 1, 2005, at 10:23 AM, Rolf Turner wrote:
>

>>foo<-function(x,f) { sink(f); print(format(x)); sink(); }

>
>
> many thanks! doh ;)
>
> ?format is unclear on return value imho.

?format does describe the return value, though in the Details section rather than in Value:

      These functions convert their first argument to a vector (or
      array) of character strings which have a common format (as is done
      by 'print'), fulfilling 'length(format*(x, *)) == length(x)'.  The
      trimming with 'trim = TRUE' is useful when the strings are to be
      used for plot 'axis' annotation.

I'll try to make it clearer.

Duncan Murdoch



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Jun 02 03:30:08 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:20 EST