Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

which.is

Index of the columns of a data.frame which are a specific type


Description

Index of the columns of a data.frame which are a specific type.

Usage

which.is(x,method="factor")

Arguments

x

A data.frame where some columns are expected to be factor variables.

method

A character value about the type. One of, "numeric","factor","integer","logical".

Details

The function is written in C++ and this is why it is very fast.

Value

A vector with the column indices which are factor variables. If there are no factor variables it will return an empty vector.

Author(s)

Manos Papadakis <papadakm95@gmail.com>

R implementation and documentation: Manos Papadakis <papadakm95@gmail.com>.

See Also

Examples

res<-which.is(iris)

Rfast

A Collection of Efficient and Extremely Fast R Functions

v2.0.1
GPL (>= 2.0)
Authors
Manos Papadakis, Michail Tsagris, Marios Dimitriadis, Stefanos Fafalios, Ioannis Tsamardinos, Matteo Fasiolo, Giorgos Borboudakis, John Burkardt, Changliang Zou, Kleanthi Lakiotaki and Christina Chatzipantsiou.
Initial release
2020-09-13

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.