Add column to DataFrame in sparkR

前端 未结 2 536
栀梦
栀梦 2021-01-11 11:00

I would like to add a column filled with a character N in a DataFrame in SparkR. I would do it like that with non-SparkR code :

df$new_column &l         


        
2条回答
  •  无人及你
    2021-01-11 11:36

    There's an easier way to use SparkR::lit() that more closely mimics the syntax you tried first:

    df$new_column <- lit("N")
    

提交回复
热议问题