Skip to contents

Casts the column to a different data type.

Usage

cast(x, dataType)

# S4 method for Column
cast(x, dataType)

Arguments

x

a Column.

dataType

a character object describing the target data type. See Spark Data Types for available data types.

Note

cast since 1.4.0

See also

Other column_func: alias(), between(), endsWith(), otherwise(), over(), startsWith(), substr()

Examples

if (FALSE) {
  cast(df$age, "string")
}