From s.wood at bath.ac.uk  Mon Nov 28 14:09:42 2005
From: s.wood at bath.ac.uk (s.wood@bath.ac.uk)
Date: Mon, 28 Nov 2005 14:09:42 +0100 (CET)
Subject: [Rd] terms.object documentation bug? (PR#8353)
Message-ID: <20051128130942.2769823221@slim.kubism.ku.dk>

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



[Rd] terms.object documentation bug? (PR#8353)
s.wood@bath.ac.uk