ncol: Number of columns in a data frame

View source: R/ncol.R

ncolR Documentation

Number of columns in a data frame

Description

Since columns are also variables, this is also the number of variables in a data frame. See base::names() to find what the variables are called.

Details

ncol(data)

See Also

nrow(), base::names()

Examples

tibble(
  x = 1:5,
  y = 6:10
) %>%
  ncol()

#> [1] 2

-----------------------------------

library(gapminder)

gapminder %>% ncol()

#> [1] 6


cobriant/qelp documentation built on July 1, 2022, 7:24 a.m.