Re: [Rd] terms.object documentation bug? (PR#8353)

From: <ripley_at_stats.ox.ac.uk>
Date: Mon 28 Nov 2005 - 18:55:05 GMT


On Mon, 28 Nov 2005 s.wood@bath.ac.uk wrote:

> Full_Name: simon wood
> Version: 2.2.0 (and lower)
> OS: linux/windows
> Submission from: (NULL) (86.135.153.59)
>
>
> I think that the documentation for the `specials' attribute of a `terms.object'
> is not quite right:
>
> specials: If the 'specials' argument was given to 'terms.formula' there
> is a 'specials' attribute, a list of vectors indicating the
> terms that contain these special functions.

This is wrong, but it does not say `in the list of terms'.

> should read something like:
>
> specials: If the 'specials' argument was given to 'terms.formula' there
> is a 'specials' attribute, a list of vectors indicating the
> variables that contain these special functions.

You are right it refers to the variables, but we need to make clear that the vectors are numeric indices, and into what (not the variables attribute).

> Here is some example code illustrating the problem:
>
> tf <- terms.formula(y~x+x:z+s(x),specials="s") ## make a `terms' object
> attr(tf,"specials") ## documented to index `s' in list of terms
> ## but in lists of terms, `s' is in position 2, not 4 ....
> attr(tf,"term.labels")
> colnames(attr(tf,"factors"))
>
> ## in lists of variables `s' *is* in position 4...
> attr(tf,"variables")
> rownames(attr(tf,"factors"))

Thanks, I have adapted that for the help page.

-- 
Brian D. Ripley,                  ripley@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
Received on Tue Nov 29 06:06:33 2005

This archive was generated by hypermail 2.1.8 : Tue 29 Nov 2005 - 02:21:23 GMT