Acts just like 'pull()' from 'dplyr' except that it only returns the unique values.

u_pull(data, var = -1, sorted = FALSE, na.rm = FALSE)

Arguments

data

a table of data

var

A variable specified as:

  • a literal variable name

  • a positive integer, giving the position counting from the left

  • a negative integer, giving the position counting from the right.

The default returns the last column (on the assumption that's the column you've created most recently).

This argument is taken by expression and supports quasiquotation (you can unquote column names and column positions).

sorted

(boolean) sort the output; default FALSE

na.rm

(boolean) remove NA; default FALSE

Examples

suppressPackageStartupMessages(library(dplyr)) tibble::tibble(a = c(1:3, 1:3), b = LETTERS[1:6]) %>% u_pull(a)
#> [1] 1 2 3