R/pull.R

Defines functions pull

Documented in pull

#' @title Pull out a single variable
#' @description Analogous function for \code{pull} in \pkg{dplyr}
#' @param .data data.frame
#' @param col A name of column or index (should be positive).
#' @return A vector
#' @seealso \code{\link[dplyr]{pull}}
#' @examples
#' mtcars %>% pull(2)
#' mtcars %>% pull(cyl)
#' mtcars %>% pull("cyl")
#' @export


pull = function(.data,col) .data[[substitute(col)]]

Try the tidyft package in your browser

Any scripts or data that you put into this service are public.

tidyft documentation built on April 14, 2020, 7:10 p.m.