Rename columns in the current H2O frame

Syntax

Rename a single column

    _h2oframe _rename old new

Rename groups of columns

    _h2oframe _rename (old1 old2 ...) (new1 new2 ...)

Change the case of groups of column names

    _h2oframe _rename old1 old2 ..., {upper|lower|proper}

where old and new specify the existing and the new column names. The rules for specifying them are as follows:

  1. Specify the existing column name followed by the new name. For example, _h2oframe _rename stat status renames stat to status.

  2. Use parentheses to specify multiple columns for old and new. For example, _h2oframe _rename (stat inc) (status income) renames stat to status and inc to income.

 options            Description
 -----------------------------------------------------------------------------------
 upper              uppercase ASCII letters in column names (UPPERCASE)
 lower              lowercase ASCII letters in column names (lowercase)
 proper             propercase ASCII letters in column names (Propercase)
 -----------------------------------------------------------------------------------
 These options correspond with the third syntax.  One of upper, lower, or proper must
 be specified.

Description

_h2oframe _rename changes the name of one or more existing columns to the new names specified; the contents of the columns are unchanged.

Options for changing the case of groups of column names

upper, lower, and proper specify how the columns are to be renamed. upper specifies that ASCII letters in column names be changed to uppercase; lower, to lowercase; and proper, to having the first ASCII letter capitalized and the remaining ASCII letters in lowercase. One of these three options must be specified.

Examples

 Setup
     . webuse renamexmpl
     . _h2oframe _put, into(renamexmpl)
     . _h2oframe _change renamexmpl
     . _h2oframe _describe

 Change name of exp to experience and inc to income
     . _h2oframe _rename exp experience
     . _h2oframe _rename inc income

 Describe the data
     . _h2oframe _describe

 -----------------------------------------------------------------------------------
 Setup
     . sysuse auto
     . _h2oframe _put, into(auto)
     . _h2oframe _change auto
     . _h2oframe _describe

 Change name of make to make2 and price to price2
     . _h2oframe _rename (make price) (make2 price2)

 Describe the data
     . _h2oframe _describe