codebook: Create a codebook from a data frame

View source: R/codebook.R

codebookR Documentation

Create a codebook from a data frame

Description

Create a codebook of a data frame using skimr::skim() that can help fine-tuning col_types and help with simple data cleaning tasks when processing a delimited file using readr.

Usage

codebook(data, ...)

Arguments

data

A tibble, or an object that can be coerced into a tibble.

...

Columns to select for skimming. When none are provided, the default is to skim all columns.

Value

A custom skimr::skim() output. Unlike skimr::skim(), histograms are not generated but there are additional skimmers:

integer

By default, skimr handles integers and doubles identically. We separate the two. For integers we add more quantiles to the default statistics.

numeric

For doubles. In addition to statistics in integer, we also check wether the column could be converted to integer.

character

Extend default statistics with a check whether the column could be converted to numeric and list the first couple of unique values.

Examples

codebook(dplyr::starwars)

svraka/asmisc documentation built on June 12, 2025, 12:04 p.m.