The green book tells:"The basic technique is classic :keep it simple ."A long 
,complicated expression or function is less fravorable than" a relatively small 
computations that combines calls to a few other functions to perform its tasks."

But I don't get the point totally.Can anyone give me an example to make me 
understand this rules totally?

ps:
Is it mean that f1 is better than f2?  Thank you!


f1<-function(x){
n<-length(x)
s<-sum(x)
m<-s/n}

f2<-
function(x){
m<-sum(x)/length(x)}                            


2005-10-23

------
Deparment of Sociology
Fudan University

My new mail addres is [EMAIL PROTECTED]
Blog:http://sociology.yculblog.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

Reply via email to