Add column to DataFrame in sparkR
The straight solution will be to use SparkR::lit()
function:
df_new = withColumn(df, "new_column_name", lit("N"))
Edit 7/17/2019
In newer Spark versions, the following also works:
df1$new_column <- "N"
df1[["new_column"]] <- "N"