[R] Function output

David Winsemius dwinsemius at comcast.net
Sun Sep 20 17:21:00 CEST 2009


On Sep 20, 2009, at 10:59 AM, manta wrote:

>
> Good afternoon,
> I know it is a simple question but I cannot figure out how to solve  
> this
> issue.
> I have a function that calculate two objects. I would like to choose
> everytime about the tree object, with default to not show it.

I cannot understand that. Perhaps you can try again to tell us what  
you want to do with tree?

>
> OP<-function(S=100,X,sigma,mu=0,r=0,time=1,n)
> {
> 	value=(S)	
> 	......			
>    	tree = matrix(rev(tree), byrow = FALSE, ncol = n + 1)	

... where did tree first get defined?

> 	return(value[1])

... do you really want to return only value[1] _and_not_ tree? If you  
exit the function this way, tree will get lost.


> }
>

David Winsemius, MD
Heritage Laboratories
West Hartford, CT




More information about the R-help mailing list