withField
withField.Rd
Adds/replaces field in a struct Column
by name.
Usage
withField(x, fieldName, col)
# S4 method for class 'Column,character,Column'
withField(x, fieldName, col)
Examples
if (FALSE) { # \dontrun{
df <- withColumn(
createDataFrame(iris),
"sepal",
struct(column("Sepal_Width"), column("Sepal_Length"))
)
head(select(
df,
withField(df$sepal, "product", df$Sepal_Length * df$Sepal_Width)
))
} # }