Skip to contents

Get the number of columns in a data frame. A fast, unsafe alternative to base::ncol().

Usage

fncol(x)

Arguments

x

(data.frame)
The data frame to get the number of columns.

Value

Scalar integer

See also

Examples

#----------------------------------------------------------------------------
# fncol() examples
#----------------------------------------------------------------------------
library(bkbase)

x <- data.frame(a = 1)
fncol(x)
#> [1] 1