Passing extra arguments to FUN=mean or median in apply
seems fine, but when FUN=min warnings are generated?
See below.

Any ideas why?

Best regards,
Ryszard

Ryszard Czerminski
AstraZeneca Pharmaceuticals LP
 
> m
     [,1] [,2]
[1,]    1    2
[2,]    3   NA
[3,]   NA   NA
> apply(m, 1, median, na.rm=T)
[1] 1.5 3.0  NA
> apply(m, 1, mean, na.rm=T)
[1] 1.5 3.0 NaN
> apply(m, 1, min, na.rm=T)
[1]   1   3 Inf
Warning message:
In FUN(newX[, i], ...) : no non-missing arguments to min; returning Inf
>

______________________________________________
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