Skip to contents

Return data.frame of column types

Usage

data_types(data)

Arguments

data

<data.frame>

Value

<data.frame> or <tibble>

Examples

(x <- dplyr::tibble(int = c(1:9, NA_integer_), chr = letters[1:10], date = Sys.Date()))
#> # A tibble: 10 × 3
#>      int chr   date      
#>    <int> <chr> <date>    
#>  1     1 a     2024-12-25
#>  2     2 b     2024-12-25
#>  3     3 c     2024-12-25
#>  4     4 d     2024-12-25
#>  5     5 e     2024-12-25
#>  6     6 f     2024-12-25
#>  7     7 g     2024-12-25
#>  8     8 h     2024-12-25
#>  9     9 i     2024-12-25
#> 10    NA j     2024-12-25

data_types(x)
#> # A tibble: 3 × 3
#>   column type      missing
#>   <chr>  <chr>       <int>
#> 1 int    integer         1
#> 2 chr    character       0
#> 3 date   date            0