cast: Casts the column to a different data type.

Description Usage Arguments Note See Also Examples

Description

Casts the column to a different data type.

Usage

1
2
3
4
cast(x, dataType)

## S4 method for signature '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

1
2
3
4
## Not run: 
  cast(df$age, "string")

## End(Not run)

SparkR documentation built on June 3, 2021, 5:05 p.m.