Returns a summary of each column's class, type, and missing data. If the data frame was imported from an SPSS .sav file and the \"labelled\" package is installed, SPSS variable labels will also be included.
Value
A tibble with a row for each column in x
, containing:
column
: Column nameclass
: Column classtype
: Column typevalid_n
: Number of non-missing valuesvalid_pct
: Percentage of non-missing valueslabel
: SPSS variable label (if applicable)
Examples
cols_info(dplyr::starwars)
#> # A tibble: 14 × 5
#> column class type valid_n valid_pct
#> <chr> <chr> <chr> <dbl> <dbl>
#> 1 name character character 87 1
#> 2 height integer integer 81 0.931
#> 3 mass numeric double 59 0.678
#> 4 hair_color character character 82 0.943
#> 5 skin_color character character 87 1
#> 6 eye_color character character 87 1
#> 7 birth_year numeric double 43 0.494
#> 8 sex character character 83 0.954
#> 9 gender character character 83 0.954
#> 10 homeworld character character 77 0.885
#> 11 species character character 83 0.954
#> 12 films list list 87 1
#> 13 vehicles list list 87 1
#> 14 starships list list 87 1