Skip to content
This repository
Browse code

Tweaks to documentation to pass R CMD check

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

0 notes on commit 1f28d27

Please sign in to comment.
Something went wrong with that request. Please try again.