SparkR (version 2.4.6)

cast: Casts the column to a different data type.

Description

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.

See Also

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

Examples

Run this code
# NOT RUN {
  cast(df$age, "string")
# }

Run the code above in your browser using DataCamp Workspace