Ista,
Since you seem to know your stuff very well, how would you get 120 out of a
function that gives you the factorial of 5, without using factorial(5)?
> Meanwhile, look at this example instead:
> fac<-function(x){a<-1
> for(i in 1:x){
> a<-a*i
> print(a)}}
gives you 120, but you cannot access it after the end of execution.
--
View this message in context:
http://r.789695.n4.nabble.com/Using-FUNCTION-to-create-usable-objects-tp4588681p4590549.html
Sent from the R help mailing list archive at Nabble.com.
______________________________________________
[email protected] 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.