[R] Odp: Finding the mean.
petr.pikal at precheza.cz
Mon Mar 12 08:13:46 CET 2012
> Using functions how would I go about do this question?
> (I already have a mean defined for a function of x.)
> Write a function called MyMean2. This function has two arguments, x and
> nonzero, where nonzero has the default value TRUE. This function should
> (Previous defined mean of x) if nonzero=FALSE
> (Previous defined mean of x) for all x's>0 if nonzero=TRUE
You already have got an answer but it would be probably better to change
zeroes to NA values and use
If the zeroes have meaning you can leave them, if they represent NA change
them to NA.
It seems to me better approach.
> Much appreciated.
> elliot.welch at virgin.net
> Sent from my BlackBerry® smartphone
> R-help at r-project.org mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help