I apologize for my typos. The corrected version of the moving median trick
is (I hope!):
n<-length(z)
z.stack<- c(z[(1:(n-2)],z[2:(n-1)],z[3:n])
indx<-rep(1:(n-2),3)
z.ord<-z.stack[order(indx,z.stack)]
runmeds<-z.ord[seq(2,3*(n-2),by=3)
No excuses!
Cheers,
Bert Gunter
------------------------------------------------------------------------------
Notice: This e-mail message, together with any attachments, contains
information of Merck & Co., Inc. (Whitehouse Station, New Jersey, USA) that may
be confidential, proprietary copyrighted and/or legally privileged, and is
intended solely for the use of the individual or entity named on this message.
If you are not the intended recipient, and have received this message in error,
please immediately return this by e-mail and then delete it.
==============================================================================
|