Having a dataframe like this
data.frame(id = c(1,2), num = c("30, 4, -2,","10, 20"))
How is it possible to take the sum of every row from the column num, and include the minuse into the calculation? Example of expected output?
data.frame(id = c(1,2), sum = c(32, 30)