data.frames, particularly those derived from NLSY Extracts.data.frames, particularly those derived from NLSY Extracts.
VerifyColumnExists( dataFrame, columnName )
RenameColumn( dataFrame, oldColumnName, newColumnName )
RenameNlsyColumn( dataFrame, nlsyRNumber, newColumnName )data.frame whose columns are to be verified or renamed.data.frame.RenameColumn and RenameNlsyColumn functions do not use side-effects to rename the data.frame. Instead, it returns a new data.frame. In the example below, notice the assignment to ds: ds <- RenameNlsyColumn(...).The VerifyColumnExists function check that exactly one column exists with the specified columnName. If so, the index of the column is returned. If not, an exception is thrown.
In the NLS Investigator, a decimal is present in the RNumber (eg, R00001.00). When the Investigator saves the dataset as a CSV, the decimal is removed (eg, R0000100).