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

From: <s.wood_at_bath.ac.uk>
Date: Mon 28 Nov 2005 - 13:09:42 GMT


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.

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.

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"))

best,
Simon



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Tue Nov 29 00:15:39 2005

This archive was generated by hypermail 2.1.8 : Mon 20 Feb 2006 - 03:21:34 GMT