Skip to contents

When working with new datasets it is helpful to know what type of data is included and easily retype the columns and provide new column names. This function identifies the type of data in each column and provides unique examples data within each column. The results are written to an Excel workbook. The new column names and re-defined column types can easily be added to the Excel workbook, imported into R, and assigned to the original dataset. The goal is to reduce the logistical burden of the user.

This function will likely evolve overtime.

Re-running this command will overwrite previous versions of the file!!

Usage

dataset.summary(
  dataset,
  ExcelFileName,
  n.examples = 4,
  overwriteXLS = FALSE,
  group.same.cols = TRUE
)

Arguments

dataset

tibble or data.frame of interest

ExcelFileName

string indicating the Excel workbook filename. The value is passed to WriteXLS::WriteXLS(). Re-running this command will overwrite previous versions of the file!!

n.examples

integer value indicating the number examples to return. Passed to size of extract.unique().

overwriteXLS

logical to overwrite existing Excel workbook; default is FALSE

group.same.cols

logical indicating if the columns should be grouped by those with the same information.

Value

tibble of column names, types, and examples

Examples

if (FALSE) { # \dontrun{
dataset.summary(dataset=ds.orig,
                ExcelFileName="ds_Column-names-and-data-types-and-examples.xlsx",
                n.examples=4)
} # }