Convert a Column to a New Type

DESCRIPTION:

Converts a column (or columns) in a 1- or 2-dimensional dataset to a particular data type.

USAGE:

convert.col.type(target, column.spec, column.type, ...) 

REQUIRED ARGUMENTS:

target
1- or 2-dimensional dataset in which the column(s) will be converted. A 1-dimensional dataset is considered to be a single, unnamed column.
column.spec
logical, integer, or character (name-matching) vector specifying the column(s) of target which is/are to be converted. To specify all columns of target, use "@ALL" or ""; to specify the last column of target, use "@END" or "". For 2-dimensional non-matrices, specifying non-existent column(s) will result in appending column.spec column(s) to target; to specify the last column of target plus one, use a character value not matching any of the column names of target; in that case, column.spec will be used for the name(s) of the appended column(s). For matrices, column.spec must be "@ALL" or "".
column.type
character value specifying the data type to which the converted column(s) will be coerced. Valid values are "dates", or anything for which paste("as", column.type, sep=".") exists.

VALUE:

The target dataset with the column(s) converted.

SEE ALSO:

, , , , .

EXAMPLES:

market.ordered.inc <- convert.col.type(market.frame, "mean.inc", "ordered")