Permalink
Browse files

Add defaults back in because ggplot2 depends on it

  • Loading branch information...
1 parent dbeafcc commit a0b38d6663433b31ee62e90edc676d7bf2d9bb87 @hadley hadley committed Mar 2, 2011
Showing with 27 additions and 7 deletions.
  1. +2 −2 DESCRIPTION
  2. +1 −0 NAMESPACE
  3. +0 −5 NEWS
  4. +10 −0 R/helper-defaults.r
  5. +14 −0 man/defaults.Rd
View
@@ -21,8 +21,8 @@ License: MIT
LazyData: true
Collate: 'dimensions.r' 'helper-arrange.r'
'helper-col-wise.r' 'helper-count.r'
- 'helper-data-frame.r' 'helper-each.r'
- 'helper-match-df.r' 'helper-mutate.r'
+ 'helper-data-frame.r' 'helper-defaults.r'
+ 'helper-each.r' 'helper-match-df.r' 'helper-mutate.r'
'helper-quick-df.r' 'helper-rename.r'
'helper-round-any.r' 'helper-splat.r'
'helper-strip-splits.r' 'helper-summarise.r'
View
@@ -4,6 +4,7 @@ export(desc)
export(colwise, numcolwise, catcolwise)
export(count)
export(as.data.frame.function)
+export(defaults)
export(each)
export(match_df)
export(mutate)
View
5 NEWS
@@ -28,11 +28,6 @@ BUG FIXES
levels that don't occur in the data, and `drop = T` to remove combinations
of levels that don't occur.
-DEPRECATED FUNCTIONS
-
-* removed `defaults` function - this is better implemented as the base
- `modifyList` function.
-
Version 1.4 (2011-01-03)
------------------------------------------------------------------------------
View
@@ -0,0 +1,10 @@
+#' Set defaults.
+#' Convient method for combining a list of values with their defaults.
+#'
+#' @param x list of values
+#' @param y defaults
+#' @keywords manip
+#' @export
+defaults <- function(x, y) {
+ c(x, y[setdiff(names(y), names(x))])
+}
View
@@ -0,0 +1,14 @@
+\name{defaults}
+\alias{defaults}
+\title{Set defaults.}
+\usage{defaults(x, y)}
+
+\description{
+ Set defaults. Convient method for combining a list of
+ values with their defaults.
+}
+\keyword{manip}
+\arguments{
+ \item{x}{list of values}
+ \item{y}{defaults}
+}

0 comments on commit a0b38d6

Please sign in to comment.