This function allows to rename a field or multiple fields.

Function Traits: Transformation

ParameterTypeRequiredDefaultDescription
asstringoptional  The new name of the field; it is used when a single field name is given in field.
fieldstring or arrayrequired  The field name to remove, if a new field name is given in as. For multiple fields, it's the list of pairs of old and new field names.

The parameter name for field can be omitted; the following forms are equivalent:

logscale
rename([[value, newValue]])

and:

logscale
rename(field=[[value, newValue]])

rename() Examples

To rename just one field use the as parameter; for example, rename field BadName to GoodName:

logscale
rename(field=BadName, as=GoodName)

Or you can rename BadName to GoodName using assignment syntax:

logscale
GoodName := rename(BadName)

To rename multiple fields use the array:

logscale
rename(field=[[fromBadName1, toGoodName1], [fromBadName2, toGoodName2]])

Or, since field is the unnamed parameter:

logscale
rename([[fromBadName1, toGoodName1], [fromBadName2, toBadName2]])

If field is given as a list of pairs, the function can be given any number of fields to rename.