[R] Using str() in a function.

David Winsemius dwinsemius at comcast.net
Thu Jul 14 06:05:01 CEST 2011

On Jul 13, 2011, at 10:54 PM, andrewH wrote:

> David --  Ah! Excellent. OK, that explains Dennis's function's output.
> Print(str(X)) evaluates str(X), sending the usual str() output to the
> console as a side effect, and then prints what str() returns, which  
> is NULL.
> And invisible() prints NULL again,

almost ... it _returns_ NULL ... without printing

> but we don't see NULL NULL, because the
> second one is invisible.
> Still puzzled by the order of my output, though.

Dalgaard's explanation didn't work for you?

> andrewH
> --
> View this message in context: http://r.789695.n4.nabble.com/Using-str-in-a-function-tp3655785p3666543.html
> Sent from the R help mailing list archive at Nabble.com.
> ______________________________________________
> R-help at 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.

David Winsemius, MD
West Hartford, CT

More information about the R-help mailing list