Skip to content

Commit 7b28ae9

Browse files
author
smeyer
committed
drop.terms clarification (from PR#17169), markup
git-svn-id: https://svn.r-project.org/R/trunk@87420 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent 2bdd816 commit 7b28ae9

File tree

3 files changed

+26
-23
lines changed

3 files changed

+26
-23
lines changed

src/library/stats/man/delete.response.Rd

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
% File src/library/stats/man/delete.response.Rd
22
% Part of the R package, https://www.R-project.org
3-
% Copyright 1995-2022 R Core Team
3+
% Copyright 1995-2024 R Core Team
44
% Distributed under GPL 2 or later
55

66
\name{delete.response}
@@ -17,25 +17,28 @@ drop.terms(termobj, dropx = NULL, keep.response = FALSE)
1717
\alias{delete.response}
1818
\alias{[.terms}
1919
\arguments{
20-
\item{termobj}{A \code{terms} object}
20+
\item{termobj}{a \code{\link[=terms.object]{terms}} object.}
2121
\item{termlabels}{character vector giving the right-hand side of a
2222
model formula. Cannot be zero-length.}
23-
\item{response}{character string, symbol or call giving the left-hand
23+
\item{response}{a character string, symbol or call giving the left-hand
2424
side of a model formula, or \code{NULL}.}
2525
\item{intercept}{logical: should the formula have an intercept?}
2626
\item{env}{the \code{\link{environment}} of the \code{\link{formula}}
2727
returned.}
28-
\item{dropx}{vector of positions of variables to drop from the
29-
right-hand side of the model.}
28+
\item{dropx}{a numeric vector indexing \code{labels(termobj)}
29+
(that is, the \code{"term.labels"} attribute of \code{termobj}),
30+
indicating terms to be dropped from the right-hand side of the
31+
model, or \code{NULL} (default) to keep all terms.}
3032
\item{keep.response}{Keep the response in the resulting object?}
3133
}
3234
\description{
3335
\code{delete.response} returns a \code{terms} object for the same
3436
model but with no response variable.
3537

36-
\code{drop.terms} removes variables from the right-hand side of the
37-
model. There is also a \code{"[.terms"} method to perform the same
38-
function (with \code{keep.response = TRUE}).
38+
\code{drop.terms} removes terms from the right-hand side of the
39+
model, optionally keeping the response. There is also a
40+
\code{[.terms} method performing a complementary operation: it
41+
extracts terms, always keeping the response.
3942

4043
\code{reformulate} creates a formula from a character vector. If
4144
\code{length(termlabels) > 1}, its elements are concatenated with \code{+}.

src/library/stats/man/terms.Rd

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,40 +4,40 @@
44
% Distributed under GPL 2 or later
55

66
\name{terms}
7-
\title{Model Terms}
8-
\usage{
9-
terms(x, \dots)
10-
}
117
\alias{terms}
128
%\alias{terms.terms}
139
%\alias{terms.aovlist}
1410
%\alias{terms.default}
1511
%\alias{print.terms}
1612
\alias{labels.terms}
13+
\title{Model Terms}
1714
\description{
1815
The function \code{terms} is a generic function
1916
which can be used to extract \emph{terms} objects
2017
from various kinds of \R data objects.
2118
}
19+
\usage{
20+
terms(x, ...)
21+
}
2222
\arguments{
2323
\item{x}{object used to select a method to dispatch.}
2424
\item{\dots}{further arguments passed to or from other methods.}
2525
}
2626
\details{
27-
There are methods for classes \code{"aovlist"}, and \code{"terms"}
27+
There are methods for classes \code{"aovlist"}, \code{"terms"}, and
2828
\code{"formula"} (see \code{\link{terms.formula}}):
2929
the default method just extracts the \code{terms} component of the
3030
object, or failing that a \code{"terms"} attribute (as used by
3131
\code{\link{model.frame}}).
3232

3333
There are \code{\link{print}} and \code{\link{labels}} methods for
34-
class \code{"terms"}: the latter prints the term labels (see
35-
\code{\link{terms.object}}).
34+
class \code{"terms"}: the latter extracts the term labels (see
35+
\code{?\link{terms.object}}).
3636
}
3737
\value{
3838
An object of class \code{c("terms", "formula")} which contains the
3939
\emph{terms} representation of a symbolic model. See
40-
\code{\link{terms.object}} for its structure.
40+
\code{?\link{terms.object}} for its structure.
4141
}
4242
\references{
4343
Chambers, J. M. and Hastie, T. J. (1992)

src/library/stats/man/terms.formula.Rd

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55

66
\name{terms.formula}
77
\alias{terms.formula}
8-
\title{Construct a terms Object from a Formula}
8+
\title{Construct a \code{terms} Object from a Formula}
99
\description{
1010
This function takes a formula and some optional arguments and
11-
constructs a terms object. The terms object can then be used to
12-
construct a \code{\link{model.matrix}}.
11+
constructs a \code{\link[=terms.object]{terms}} object, which
12+
can then be used to construct a \code{\link{model.matrix}}.
1313
}
1414
\usage{
1515
\method{terms}{formula}(x, specials = NULL, abb = NULL, data = NULL, neg.out = TRUE,
@@ -37,10 +37,10 @@
3737
remaining variables contained in \code{data}. Exceptionally,
3838
\code{.} can be treated as a name for non-standard uses of formulae.}
3939
}
40-
\details{
41-
Not all of the options work in the same way that they do in S and not
42-
all are implemented.
43-
}
40+
%% \note{
41+
%% Not all of the options work in the same way that they did in S and not
42+
%% all are implemented.
43+
%% }
4444
\value{
4545
A \code{terms} object is returned. It is the re-ordered formula (unless
4646
\code{keep.order = TRUE}) with several \code{\link{attributes}}, see

0 commit comments

Comments
 (0)