I have a large Excel file with data that looks like the following throughout:
I know I can use something like
data[which(data$Label == "Crop Sales ($)"),c(1,5,6,7)]
to be able to dictate which value in the "Label" column I want to be shown. However, what I want to be able to do is calculate the total amount of "Crop Sales($)" from each state to be able to see which state had the highest or lowest amount of crop sales.
For example, I want the table to look like the following :
except I would like the "Value" column to be combined so that there is only one row for each state with a combined total of crop sales.
Is there any way that this can be done?
Also, some of the values in the "Value" column contain values of "-" or "(D)" and are therefore not integer values, will this make a difference?