Skip to content

Commit

Permalink
crosstab() and tabyl() now appear in package manual
Browse files Browse the repository at this point in the history
closes #65
  • Loading branch information
sfirke committed Oct 23, 2016
1 parent c65deb8 commit c4fb37d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 16 deletions.
7 changes: 2 additions & 5 deletions R/crosstab.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@
crosstab <- function(...) UseMethod("crosstab")

#' @inheritParams crosstab
#' @describeIn crosstab Create a crosstab from two vectors.
#' @rdname crosstab
#' @export
#' @keywords internal
crosstab.default <- function(vec1, vec2, percent = "none", show_na = TRUE, ...){

if(!mode(vec1) %in% c("logical", "numeric", "character", "list") | is.matrix(vec1)){
Expand Down Expand Up @@ -101,10 +100,8 @@ crosstab.default <- function(vec1, vec2, percent = "none", show_na = TRUE, ...){
#' @inheritParams crosstab.default
#' @param .data (optional) a data.frame, in which case \code{vec1} and \code{vec2} should be unquoted column names.
#' @param ... additional arguments, if calling \code{crosstab} on a data.frame.
#' @describeIn crosstab Create a crosstab from a data.frame,
#' supplying unquoted names of the two columns to crosstab.
#' @rdname crosstab
#' @export
#' @keywords internal
crosstab.data.frame <- function(.data, ...){
# collect dots
dots <- as.list(substitute(list(...)))[-1L] #
Expand Down
3 changes: 1 addition & 2 deletions R/tabyl.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#' @param ... additional arguments, if calling \code{tabyl} on a data.frame.
#' @return Returns a data.frame with the frequencies and percentages of the tabulated variable.
#' @export
#' @rdname tabyl
#' @examples
#' # Calling on a vector:
#' val <- c("hi", "med", "med", "lo")
Expand All @@ -25,7 +24,7 @@
#'
#' # Passing in a data.frame using a pipeline:
#' library(dplyr) # to access the pipe operator
#' mtcars %>% tabyl(cyl)
#' mtcars %>% tabyl(cyl, sort = TRUE)
#'
#' # illustrating show_na functionality:
#' my_cars <- rbind(mtcars, rep(NA, 11))
Expand Down
8 changes: 0 additions & 8 deletions man/crosstab.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/tabyl.Rd

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

0 comments on commit c4fb37d

Please sign in to comment.