Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Tweaks to documentation to pass R CMD check

  • Loading branch information...
commit 1f28d2700c901e49aa9b4f8d1ffeadf20b7e9c25 1 parent 0e69e45
@hadley authored
View
2  NEWS
@@ -1,4 +1,4 @@
-plyr 0.1.9 (2008-XX-XX) ---------------------------------------------------
+plyr 0.1.9 (2008-06-23) ---------------------------------------------------
* fix bug in rbind.fill when NULLs present in list
* improve each to recognise when all elements are numeric
View
8 R/helper-summarise.r
@@ -8,14 +8,16 @@
#
# @arguments The data frame to be summarised
# @arguments Further arguments of the form var = value
+# @keyword manip
+# @alias summarize
#X summarise(baseball,
#X duration = max(year) - min(year),
#X nteams = length(unique(team)))
#X ddply(baseball, "id", summarise,
#X duration = max(year) - min(year),
#X nteams = length(unique(team)))
-summarize <- summarise <- function(`_data`, ...) {
- eval(substitute(data.frame(...)), `_data`, parent.frame())
+summarise <- function(.data, ...) {
+ eval(substitute(data.frame(...)), .data, parent.frame())
}
-
+summarize <- summarise
# Alternative names: tally? sketch? abstract? abbreviate?
View
2  R/quote.r
@@ -87,6 +87,8 @@ eval.quoted <- function(exprs, envir = parent.frame(), enclos = if (is.list(env
# @alias as.quoted.character
# @alias as.quoted.formula
# @alias as.quoted.quoted
+# @alias as.quoted.NULL
+# @alias as.quoted.numeric
# @alias c.quoted
# @alais as.quoted.NULL
#X as.quoted(c("a", "b", "log(d)"))
View
3  man/as-quoted-3f.rd
@@ -4,6 +4,9 @@
\alias{as.quoted.character}
\alias{as.quoted.formula}
\alias{as.quoted.quoted}
+\alias{as.quoted.NULL}
+\alias{as.quoted.numeric}
+\alias{c.quoted}
\title{Convert input to quoted variables}
\author{Hadley Wickham <h.wickham@gmail.com>}
View
11 man/rbind-fill-di.rd
@@ -20,5 +20,14 @@ bplayer <- split(baseball, baseball$id)
system.time(b1 <- do.call("rbind", bplayer))
rownames(b1) <- NULL
system.time(b2 <- rbind.fill(bplayer))
-stopifnot(all.equal(b1, b2))}
+stopifnot(all.equal(b1, b2))
+
+a <- data.frame(a = factor(letters[1:3]), b = 1:3, c = date())
+b <- data.frame(a = factor(letters[3:5]),
+d = as.Date(c("2008-01-01", "2009-01-01", "2010-01-01")))
+ab1 <- rbind.fill(a, b)[, letters[1:4]]
+ab2 <- rbind.fill(b, a)[c(4:6, 1:3), letters[1:4]]
+ab2$a <- factor(ab2$a, levels(ab1$a))
+rownames(ab2) <- NULL
+stopifnot(all.equal(ab1, ab2))}
\keyword{manip}
View
27 man/summarise-n4.rd
@@ -0,0 +1,27 @@
+\name{summarise}
+\alias{summarise}
+\alias{summarize}
+\title{Summarise a data frame.}
+\author{Hadley Wickham <h.wickham@gmail.com>}
+
+\description{
+Create a new data frame that summarises an existing data frame.
+}
+\usage{summarise(.data, ...)}
+\arguments{
+\item{.data}{The data frame to be summarised}
+\item{...}{Further arguments of the form var = value}
+}
+
+\details{Summarise works in an analagous way to transform, except instead of adding
+columns to an existing data frame, it creates a new one. This is
+particularly useful in conjunction with \code{\link{ddply}} as it makes it
+easy to perform group-wise summaries.}
+
+\examples{summarise(baseball,
+duration = max(year) - min(year),
+nteams = length(unique(team)))
+ddply(baseball, "id", summarise,
+duration = max(year) - min(year),
+nteams = length(unique(team)))}
+\keyword{manip}
Please sign in to comment.
Something went wrong with that request. Please try again.