I am very new to R - I am going through a script that includes the following:
new_data<-aggregate(. ~ old_data$Company+old_data$Financial_Year, data=old_data, sum)
I understand that this is what in pandas would be a groupby().sum() where everything is grouped at the company and financial year level - is that correct? is '.~' meaning all the other columns in old_data other than Company and Financial_Year?
Also if the command were to throw the error
Error in FUN(X[[i]], ...) : invalid 'type' (character) of argument
I imagine it is because some of the other columns are not numeric?
thanks in advance!