New to R here - Using Rstudio on a fedora25. I'm not sure if this is some syntax, data type or something else that is the issue here, but R is giving me the wrong output for adding/subtracting two columns in its data frame. Please have a look below and let me know what the issue is. Thanks!
Result Dataframe:
A B C D E F G
1 true 1 0 0 0 1
2 false 1 438 32 460 2
3 false 1 100 0 100 1
4 false 1 800 136 936 5
5 true 1 250 0 250 1
Code:
current['I'] <- as.numeric(unlist(current['D'])) + as.numeric(unlist(current['E']))
current['G'] <- as.numeric(unlist(current['F'])) - current['I']
current$C <- ifelse(current$G==0, "false", "true")
write.csv(current,"current.csv")
The df was read from salesforce. Thats why using unlist & as.numeric.