augment_data_helper: Get copies of a dataset with various rowname behaviors

View source: R/augment_data_helper.R

augment_data_helperR Documentation

Get copies of a dataset with various rowname behaviors

Description

Helper function for check_augment_data_specification(). There should be no need to ever use this directly in tests. Takes a dataset and returns a list with three copies of the dataset. Optionally introduces NA values into the dataset. Useful for checking that tibbles, data frames, and data frames with rownames are treated equivalently.

Usage

augment_data_helper(data, add_missing)

Arguments

data

A data set as a data.frame or tibble.

add_missing

Whether or not to set some values in data to NA. When TRUE sets the diagonal elements of data to NA and adds a row of all NAs to the end of data. This ensures that every column has missing data. Defaults to FALSE.

Value

A list with three copies of data:

  • tibble: the data in a tibble::tibble().

  • no_row: the data in a data.frame() without row names.

  • row_nm: the data in a data.frame, with row names.

See Also

.row_names_info(), rownames(), tibble::rownames_to_column()


alexpghayes/modeltests documentation built on March 7, 2024, 11 p.m.