Learn R Programming

SparkR (version 3.1.2)

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 column_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 DataLab