I have a DataFrame in sparkR 'u' which conains ID = 1 1 1 1... and age = 21 23 33 21 ... To take the sum of of 'ages' I do this
sumage<-agg(u, ages="sum")
Now sumage is a DataFrame with type double. I want to have sumage as a integer so I try this
as.numeric(sumage)
but I get this message: "sumu<- agg(u, amount_spent="sum") cannot coerce type 'S4' to vector of type 'double'"
What can be done about this ?