change_names: Change the variable names of a data.frame

View source: R/utils.R

change_namesR Documentation

Change the variable names of a data.frame

Description

Change the variable names of a data.frame

Usage

change_names(x, from, to, must_have=TRUE)

Arguments

x

data.frame

from

column names to be changed

to

what column names need to be changed to

must_have

logical. Give an error of one of the names is not present or duplicated

Value

data.frame

Examples

d <- data.frame(x=1:3, y=3:5, z=10:12)
change_names(d, c("y", "z"), c("B", "C"))

reagro/carobiner documentation built on Dec. 4, 2024, 3:21 p.m.