rename_fields: rename_fields

View source: R/rename_fields.R

rename_fieldsR Documentation

rename_fields

Description

This function facilitates the renaming of fields in a dataframe.

Usage

rename_fields(df = NULL, oldFields = NULL, newFields = NULL)

Arguments

df

default is NULL. This is the dataframe you want to modify column names in.

oldFields

default is NULL. This is a vector of fieldnames you want to rename.

newFields

default is NULL. This is a vector of the new fieldnames you want to use.

Value

returns a data.frame with the new names.

Note

The number of items in oldFields and newFields must be identical, and the order matters in that newFields[3] will replace oldFields[3].

Author(s)

Mike McMahon, Mike.McMahon@dfo-mpo.gc.ca


Maritimes/Mar.utils documentation built on Feb. 12, 2024, 11:38 p.m.