diff --git a/R/crosstab.R b/R/crosstab.R index 399c7d6e..1839c4f5 100644 --- a/R/crosstab.R +++ b/R/crosstab.R @@ -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)){ @@ -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] # diff --git a/R/tabyl.R b/R/tabyl.R index c0048fc8..89f47510 100644 --- a/R/tabyl.R +++ b/R/tabyl.R @@ -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") @@ -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)) diff --git a/man/crosstab.Rd b/man/crosstab.Rd index 88ca7955..6f4014fc 100644 --- a/man/crosstab.Rd +++ b/man/crosstab.Rd @@ -40,13 +40,6 @@ Create a crosstab, displaying either frequencies or percentages calculated by ro For fancy formatting of the resulting data.frame, see \code{\link{adorn_crosstab}}. } -\section{Methods (by class)}{ -\itemize{ -\item \code{default}: Create a crosstab from two vectors. - -\item \code{data.frame}: Create a crosstab from a data.frame, -supplying unquoted names of the two columns to crosstab. -}} \examples{ # Calling on two vectors: a <- c("hi", "hi", "lo", "lo") @@ -67,5 +60,4 @@ mtcars \%>\% filter(am == 0) \%>\% crosstab(cyl, gear) } -\keyword{internal} diff --git a/man/tabyl.Rd b/man/tabyl.Rd index bf6a68d4..afc07273 100644 --- a/man/tabyl.Rd +++ b/man/tabyl.Rd @@ -43,7 +43,7 @@ tabyl(mtcars$cyl, sort = TRUE) # 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))