Skip to content

Commit

Permalink
Merge pull request #411 from ropensci/rhub
Browse files Browse the repository at this point in the history
Stop using @inheritParams for dplyr generics
  • Loading branch information
michaelquinn32 authored Feb 24, 2019
2 parents 2af5bf5 + 6909356 commit 657158c
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 70 deletions.
28 changes: 22 additions & 6 deletions R/dplyr.r
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#' Use dplyr verb filter on skim_df objects.
#'
#' @seealso [`dplyr::filter()`]
#' @inheritParams dplyr::filter
#' @param .data A skim object
#' @param ... Logical predicates defined in terms of the variables in .data.
#' @param .preserve When FALSE (the default) the grouping structuree is recalculated
#' based on the resulting data.
#' @return skim_df object coerced to a data frame.
#' @export
filter.skim_df <-function (.data, ..., .preserve = FALSE) {
Expand All @@ -14,7 +17,8 @@ filter.skim_df <-function (.data, ..., .preserve = FALSE) {
#' Use dplyr verb select on skim_df objects.
#'
#' @seealso [`dplyr::select()`]
#' @inheritParams dplyr::select
#' @param .data A skim object
#' @param ... One or more unquoted expressions separated by commas.
#' @return skim_df object coerced to a data frame.
#' @export
select.skim_df <-function (.data, ...) {
Expand All @@ -27,7 +31,10 @@ select.skim_df <-function (.data, ...) {
#' Use dplyr verb mutate on skim_df objects.
#'
#' @seealso [`dplyr::mutate()`]
#' @inheritParams dplyr::mutate
#' @param .data A skim object
#' @param ... Name-value pairs of expressions. The name of each argument will
#' be the name of a new variable, and the value will be its
#' corresponding value.
#' @return skim_df object coerced to a data frame.
#' @export
mutate.skim_df <-function (.data, ...) {
Expand All @@ -40,10 +47,14 @@ mutate.skim_df <-function (.data, ...) {
#' Use dplyr verb arrange on skim_df objects.
#'
#' @seealso [`dplyr::arrange()`]
#' @inheritParams dplyr::arrange
#' @param .data A skim object
#' @param ... Comma separated list of unquoted variable names, or expressions
#' involving variable names.
#' @param .by_group If TRUE, will sort first by grouping variable.
#' Applies to grouped data frames only.
#' @return skim_df object coerced to a data frame.
#' @export
arrange.skim_df <-function (.data, ...) {
arrange.skim_df <-function (.data, ..., .by_group = FALSE) {
.data <- as.data.frame(.data)
.data <- dplyr::arrange(.data, ...)
class(.data) <- c("tbl_df", "tbl", "data.frame")
Expand All @@ -53,7 +64,12 @@ arrange.skim_df <-function (.data, ...) {
#' Use dplyr verb slice on skim_df objects.
#'
#' @seealso [`dplyr::slice()`]
#' @inheritParams dplyr::filter
#' @param .data A skim object
#' @param ... Integer row calues. Provide either positive values to keep or
#' negative values to drop.
#' @param .preserve when FALSE (the default), the grouping structure is
#' recalculated based on the resulting data, otherwise
#' it is kept as is.
#' @return skim_df object coerced to a data frame.
#' @export
slice.skim_df <-function (.data, ..., .preserve = FALSE) {
Expand Down
10 changes: 6 additions & 4 deletions man/arrange.skim_df.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 4 additions & 13 deletions man/filter.skim_df.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 4 additions & 14 deletions man/mutate.skim_df.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 2 additions & 20 deletions man/select.skim_df.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 6 additions & 13 deletions man/slice.skim_df.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 657158c

Please sign in to comment.