# NOT RUN {
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)
))
# }
Run the code above in your browser using DataLab