I have DataFrame 'res' in sparkR. 'res' contains ID and dates. So the first entries looks like this 'ID' = 1 2 3 ... and 'date' = "2012-6-5", "2013-5-5", "2015-10-11" ...
I want to create a new dataset where all 'dates' is subtracted with "2010-01-01". How can this be done? I have the exact same problem if I just wanted all elements in a DataFrame subtracted with an integer.
In sparkR I tried this
newres <- withColumn(res, "subtract", res$date - as.Date("2010-01-01") )
This run but when I type head(newres) I get an error:mesage: "returnstatus==0 is not True."