Hi just a quick question in which I must use the "function and return" part of 
R.

If I was asked to define a function called "median" where the function has a 
single argument x and returns the median value of a vector. How would I go 
about saying the median = element x in terms of n (say (n + 1)/2 or whatever it 
would be) if there is an even amount of elements, or x in terms of n (with a 
different way of saying how many n) if there is an odd amount of elements? 

Much appreciated 

elliot.we...@virgin.net 
Sent from my BlackBerry® smartphone
______________________________________________
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.

Reply via email to