[R] Suggestions for help & weighted.mean

From: Yan Wong <h.y.wong_at_leeds.ac.uk>
Date: Fri 11 Aug 2006 - 21:21:58 EST


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?



R-help@stat.math.ethz.ch 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. Received on Fri Aug 11 21:31:53 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sat 12 Aug 2006 - 00:19:37 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.