Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
hadley committed Sep 9, 2010
1 parent cf4429a commit f775309
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
11 changes: 5 additions & 6 deletions man/add_margins.Rd
@@ -1,7 +1,7 @@
\name{add_margins}
\alias{add_margins}
\title{Add margins to a data frame.}
\usage{add_margins(df, rows, cols, margins=TRUE)}
\usage{add_margins(df, vars, margins=TRUE)}

\description{
Add margins to a data frame.
Expand All @@ -13,9 +13,8 @@
}
\arguments{
\item{df}{input data frame}
\item{rows}{names of row margins}
\item{cols}{names of column margins}
\item{margins}{Either \code{TRUE} to compute all margins, or a character
vector of margin names, which may include any name in \code{rows} or
\code{cols}, or \code{"grand_row"} or \code{"grand_col"}.}
\item{vars}{a list of character vectors giving the variables in each
dimension}
\item{margins}{a character vector of variable names to compute margins for.
\code{TRUE} will compute all possible margins.}
}
1 change: 1 addition & 0 deletions man/cast.Rd
Expand Up @@ -87,6 +87,7 @@ dcast(chick_m, diet + chick ~ time)
acast(chick_m, diet + chick ~ time)
acast(chick_m, chick ~ time ~ diet)
acast(chick_m, diet + chick ~ time, length, margins="diet")
acast(chick_m, diet + chick ~ time, length, drop = FALSE)

#Tips example
dcast(melt(tips), sex ~ smoker, mean, subset = .(variable == "total_bill"))
Expand Down
13 changes: 6 additions & 7 deletions man/margins.Rd
@@ -1,7 +1,7 @@
\name{margins}
\alias{margins}
\title{Figure out margining variables.}
\usage{margins(rows, cols, margins)}
\usage{margins(vars, margins)}

\description{
Figure out margining variables.
Expand All @@ -16,11 +16,10 @@
\keyword{internal}
\value{list of margining combinations, or \code{NULL} if none. These are
the combinations of variables that should have their values set to
`(all)`}
\code{(all)}}
\arguments{
\item{col}{a character vector of column names}
\item{row}{a character vector of row names}
\item{margins}{a character vector of variable names to margin over. Can be
any variable name in \code{col} or \code{row}, \code{"grand_row"} or
\code{"grand_col"}. If \code{TRUE} will compute all possible margins.}
\item{vars}{a list of character vectors giving the variables in each
dimension}
\item{margins}{a character vector of variable names to compute margins for.
\code{TRUE} will compute all possible margins.}
}

0 comments on commit f775309

Please sign in to comment.