Skip to content
Browse files

Update documentation

  • Loading branch information...
1 parent cf4429a commit f77530963f59b2400da65ad6fdb682b0d09da7b1 @hadley committed Sep 9, 2010
Showing with 12 additions and 13 deletions.
  1. +5 −6 man/add_margins.Rd
  2. +1 −0 man/cast.Rd
  3. +6 −7 man/margins.Rd
View
11 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.
@@ -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.}
}
View
1 man/cast.Rd
@@ -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"))
View
13 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.
@@ -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.
Something went wrong with that request. Please try again.