Hello folks, I am new to R and I am trying to compute median profit for a particular country in a data frame.I tried below one but it doesn\'t work for me.
I was able to calculate median values for a metric in column 11 by US state in dataframe 'outcome3' using:
tapply(outcome3[,11], outcome3$State, median)