Skip to content

Commit

Permalink
Release-0.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyuchen committed Feb 22, 2017
1 parent e96ffec commit 47c05fa
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Authors@R: person("Yuchen", "Wang", email = "[email protected]",
role = c("aut", "cre"))
Description: If `dplyr` is a grammar for data manipulation, `extdplyr` is like
a short paragraph written in `dplyr`. `extdplyr` extends `dplyr` and
`tidyr` verbs to some common "routines" that manipulate datasets. It uses
`tidyr` verbs to some common "routines" that manipulate data sets. It uses
the same interface and preserves all the features from `dplyr`, has good
performance, and supports various data sources.
License: MIT + file LICENSE
Expand Down
4 changes: 2 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
export("%>%")
export(check_missing)
export(check_missing_)
export(ifelse_routine)
export(ifelse_routine_)
export(grp_routine)
export(grp_routine_)
export(ind_to_char)
export(ind_to_char_)
export(pct_routine)
Expand Down
12 changes: 6 additions & 6 deletions R/ifelse_routine.R → R/grp_routine.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Mutate a character/factor based on conditions.
#'
#' \code{ifelse_routine} functions like a serious of nested \code{ifelse} where
#' \code{grp_routine} functions like a serious of nested \code{ifelse} where
#' a series of conditions are evaluated and different values are assigned based
#' on those conditions.
#'
Expand All @@ -11,15 +11,15 @@
#' @inheritParams ind_to_char
#'
#' @export
#' @example /examples/ifelse_routine_ex.R
ifelse_routine <- function(data, col, ..., ret_factor = FALSE) {
ifelse_routine_(data, col, .dots = lazyeval::lazy_dots(...),
#' @example /examples/grp_routine_ex.R
grp_routine <- function(data, col, ..., ret_factor = FALSE) {
grp_routine_(data, col, .dots = lazyeval::lazy_dots(...),
ret_factor = ret_factor)
}

#' @describeIn ifelse_routine SE version of ifelse_routine.
#' @describeIn grp_routine SE version of grp_routine.
#' @export
ifelse_routine_ <- function(data, col, ..., .dots,
grp_routine_ <- function(data, col, ..., .dots,
ret_factor = FALSE) {
conds <- lazyeval::all_dots(.dots, ..., all_named = TRUE)

Expand Down
2 changes: 1 addition & 1 deletion cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Test environments
* local OS X install, R 3.3.2
* ubuntu 12.04 (on travis-ci), R 3.1.2
* ubuntu 12.04 (on travis-ci), R 3.3.2
* win-builder (release)

## R CMD check results
Expand Down
6 changes: 3 additions & 3 deletions examples/ifelse_routine_ex.R → examples/grp_routine_ex.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ df <- data.frame(v1 = letters[1:5], v2 = 1:5)
df

# By default, it creates new groups
ifelse_routine(df, "group",
grp_routine(df, "group",
first = v1 %in% c("a", "b"),
second = v2 == 3,
third = v2 >= 4)

# Gives a warning when the groups are not collectively exhaustive
ifelse_routine(df, "group",
grp_routine(df, "group",
first = v1 %in% c("a", "b"),
second = v2 == 3,
third = v2 > 4)


# SE version
ifelse_routine_(df, "group",
grp_routine_(df, "group",
"first" = ~ v1 %in% c("a", "b"),
"second" = ~ v2 == 3,
.dots = setNames(list(~ v2 > 4), "third"))
22 changes: 11 additions & 11 deletions man/ifelse_routine.Rd → man/grp_routine.Rd

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

2 changes: 1 addition & 1 deletion man/ind_to_char.Rd

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

0 comments on commit 47c05fa

Please sign in to comment.