which-type: Where are certain types of columns?

Description Usage Arguments Examples

Description

Determines the names or locations (i.e., index) of particular types of columns.

Usage

1
2
3
4
5
6
7

Arguments

x

A data frame (ideally), but list-like objects should work too.

names

Logical indicating whether to return names (TRUE) or indexes FALSE. Default is TRUE.

Examples

1
2
3
4
5
6
which_numeric(iris)
which_factor(iris)
d <- data.frame(x = 1:3, y = c("a", "b", "c"), stringsAsFactors = FALSE)
which_integer(d)
which_numeric(d)
which_character(d)

bgreenwell/bmisc documentation built on Sept. 24, 2019, 11:09 a.m.