default_colnames: Assign Generic Column Names to an Object

View source: R/utils.R

default_colnamesR Documentation

Assign Generic Column Names to an Object

Description

Assign Generic Column Names to an Object

Usage

default_colnames(X, name_base = "X")

Arguments

X

An object that can receive a colnames attribute

name_base

Stem for each default column name. Default "X".

Details

Old column names are retained unless they are the empty string. Any such column names are replaced by new default names numbered from 1. All columns are treated this way if colnames(X) is NULL.

Value

X, with its colnames attribute modified as described.

Examples

X <- matrix(1:16, nrow = 2)
default_colnames(X)

ryan-heslin/RegLesson documentation built on Aug. 5, 2022, 9:03 p.m.