Skip to content

Commit

Permalink
deprecate liply and isplit2
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirill Müller committed Apr 8, 2015
1 parent b61b64b commit b2c531c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
8 changes: 8 additions & 0 deletions R/liply.r
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#' than the O(n ^ 2) performance from the naive strategy of growing the list
#' each time.
#'
#' @section Warning:Deprecated, do not use in new code.
#' @seealso \code{\link{plyr-deprecated}}
#' @keywords manip
#' @param .iterator iterator object
#' @param .fun function to apply to each piece
Expand All @@ -21,7 +23,9 @@
#' # Iterators get used up:
#' liply(baseball_id, summarise, mean_rbi = mean(rbi, na.rm = TRUE))
#' }
# EXCLUDE COVERAGE START
liply <- function(.iterator, .fun = NULL, ...) {
.Deprecated("llply")
stopifnot(inherits(.iterator, "iter"))
if (is.null(.fun)) return(as.list(.iterator))

Expand Down Expand Up @@ -52,13 +56,17 @@ liply <- function(.iterator, .fun = NULL, ...) {

#' Split iterator that returns values, not indices.
#'
#' @section Warning:Deprecated, do not use in new code.
#' @seealso \code{\link{plyr-deprecated}}
#' @keywords internal
#' @export
isplit2 <- function (x, f, drop = FALSE, ...) {
.Deprecated(c("splitter_d", "splitter_a"))
it <- iterators::isplit(seq_len(nrow(x)), f, drop = drop, ...)
nextEl <- function() {
i <- iterators::nextElem(it)
x[i$value, , drop = FALSE]
}
structure(list(nextElem = nextEl), class = c("abstractiter", "iter"))
}
# EXCLUDE COVERAGE END
12 changes: 12 additions & 0 deletions R/plyr-deprecated.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#' Deprecated Functions in Package plyr
#'
#' These functions are provided for compatibility with older versions of
#' \code{plyr} only, and may be defunct as soon as the next release.
#'
#' @usage
#' liply(...)
#' isplit2(...)
#' @name plyr-deprecated
# EXCLUDE COVERAGE START
NULL
# EXCLUDE COVERAGE END

0 comments on commit b2c531c

Please sign in to comment.