[R] Function output difficulties

2008-12-03 Thread emj83

is there anyway for some parts of the function output to not be returned,
even if the output has been used to calculate a further part of the
function? i have tried invisible() to no avail.

Thanks Emma
-- 
View this message in context: 
http://www.nabble.com/Function-output-difficulties-tp20813117p20813117.html
Sent from the R help mailing list archive at Nabble.com.

__
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] Function output difficulties

2008-12-03 Thread Ted Harding
On 03-Dec-08 13:41:53, emj83 wrote:
 is there anyway for some parts of the function output to not be
 returned, even if the output has been used to calculate a further
 part of the function? i have tried invisible() to no avail.
 
 Thanks Emma

It's not clear what you mean by some parts of the function output.
The function output is whatever you nominate it to be, and can
include any selection of whatever was computed within the function.

For example:

  testfn - function(x){
X - x^2 ; Y - cos(X) ; Z - (X + Y)/(1 + x)
c(X,Z)
  }

  testfn(1.1)
# [1] 1.21 0.744295

However, I suspect your case may be a bit more complicated than that!
If you were to post the function (or something like it), explaining
what you want it to return, and in what way it returns what you do
not want, it would be easier to help.

Ted.


E-Mail: (Ted Harding) [EMAIL PROTECTED]
Fax-to-email: +44 (0)870 094 0861
Date: 03-Dec-08   Time: 19:03:29
-- XFMail --

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