What you are saying is that an undocumented default does not apply to your usage. So all you need to do, surely, is to set the argument yourself?

Your 'correction' makes e.g. kernel("daniell") invalid.

I"ve applied a change in R-devel that means 'm' will not need to be supplied if 'coef' is numeric.

On Tue, 30 Nov 2010, Pierre Chausse wrote:

 Hi,

There is a small bug in the kernel() function. Everything is fine when
we use the format:

kernel("name",m,r)

but if we want the first argument to be a vector, which is useful is we
are interested in using a method not implemented in kernel(), the
default value of m is wrong. For example, if we do:

s <- rep(1/11,6)
k <- kernel(s)

we get the error message

Error in kernel(s) : 'coef' does not have the correct length

The problem is that the default value, which is not indicated in the
help file,  violate the condition that length(coef) must be equal to
(m+1). Therefore, the first line of the function, which is:

function (coef, m = length(coef) + 1, r, name = "unknown")
{

should be changed to

function (coef, m = length(coef) - 1, r, name = "unknown")
{

bests

--
*Pierre Chauss?*
Assistant Professor
Department of Economics
University of Waterloo

        [[alternative HTML version deleted]]



--
Brian D. Ripley,                  rip...@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to