[R] Suggestions for help & weighted.mean

Yan Wong h.y.wong at leeds.ac.uk
Fri Aug 11 13:21:58 CEST 2006


Hi, just a quick question:

Should weighted.mean be able to cope with the specific case where one  
weight is Inf? I came across this when trying to implement a simple  
weighted moving average algorithm for surface smoothing: these  
algorithms often result in a single infinite weight when predicting  
the surface value at known data points.

e.g.

 > weighted.mean(c(77,88,99), c(Inf, 1, 2)) #should this return 77?
[1] NaN

Cheers

Yan

p.s. a while ago I suggested using '??xxx' as a shortcut for  
help.search("xxx"), much like '?xxx' is a shortcut for help("xxx"). I  
was just wondering if anyone had any more thoughts on the matter?



More information about the R-help mailing list