Learn R Programming

jpinfect (version 2023.2026.02)

.col_rename: Clean and Format Column Names

Description

This helper function cleans and formats column names of a dataset for consistent and readable formatting.

Usage

.col_rename(dataset, rep_each = 1)

Value

A character vector containing cleaned and formatted column names.

Arguments

dataset

A data frame or tibble whose column names need to be cleaned.

rep_each

An integer specifying the repetition count for column names. Defaults to 1.

Details

The function removes unnecessary characters, trims whitespace, replaces certain patterns for consistency, and optionally repeats the column names based on the rep_each parameter.