[R] looking for equivalent of matlab's medfilt1 function

2007-05-07 Thread Vladimir Eremeev

Dear all, 
I have several files with Matlab code, which I am translating to R.

For the zero-level approach, I took the very old shell script from R-help
archives, which has made some obvious leg-work such as replacement of =
with -.

Now I am translating indexing, matrix operations and function call using
this table
http://37mm.no/mpy/octave-r.html

The problem is, I cannot find the R equivalent of the matlab's function
medfilt1, performing 1-dimensional median filtering of a vector. Its summary
is here http://www-ccs.ucsd.edu/matlab/toolbox/signal/medfilt1.html

-- 
View this message in context: 
http://www.nabble.com/looking-for-equivalent-of-matlab%27s-medfilt1-function-tf3704211.html#a10358868
Sent from the R help mailing list archive at Nabble.com.

__
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.


Re: [R] looking for equivalent of matlab's medfilt1 function

2007-05-07 Thread Martin Maechler
 Vladimir == Vladimir Eremeev [EMAIL PROTECTED]
 on Mon, 7 May 2007 07:58:48 -0700 (PDT) writes:

Vladimir Dear all, 
Vladimir I have several files with Matlab code, which I am translating to 
R.

Vladimir For the zero-level approach, I took the very old
Vladimir shell script from R-help archives, which has made
Vladimir some obvious leg-work such as replacement of =
Vladimir with -.

Vladimir Now I am translating indexing, matrix operations and function 
call using
Vladimir this table
Vladimir http://37mm.no/mpy/octave-r.html

You should also look at the 'matlab' package which
defines quite a few R functions such as eyes(), zeros(), repmat(),
to behave as the Matlab functions do.


Vladimir The problem is, I cannot find the R equivalent of the matlab's 
function
Vladimir medfilt1, performing 1-dimensional median filtering of a vector. 
Its summary
Vladimir is here 
http://www-ccs.ucsd.edu/matlab/toolbox/signal/medfilt1.html
To statisticians, this has been known as running medians,
thanks to John Tukey.
The smooth() function contains smart variations of 
running median of 3 which seems to be the matlab default.

For 'k  3', I'd recommend the fast  runmed(x, k)
function which also has a bit more sophisticated end-point
handling than Matlab's medfilt1() seems to provide.

Martin

__
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.