nrow: Number of rows in a data frame

View source: R/nrow.R

nrowR Documentation

Number of rows in a data frame

Description

Since rows are also observations, this is also the number of observations in a data frame.

Details

nrow(data)

See Also

ncol(), base::names()

Examples

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

#> [1] 5

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

library(gapminder)

gapminder %>% nrow()

#> [1] 1704

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

# Use nrow with filter:

gapminder %>%
  filter(lifeExp > 80) %>%
  nrow()

#> [1] 21


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