My current dataframe is of the format:
name GRADUATION_RATE varname count
Example Name 1 13.0 Bus Stops 251
Example Name 1 13.0 Childcare Centers 87
Example Name 2 14.0 Bus Stops 300
Example Name 2 14.0 Childcare Centers 60
I want to expand the dataframe such that it creates new columns based on the variable name's count, so there would be as many new columns as the number of unique varnames. So the expected output for the above would be:
name GRADUATION_RATE Bus Stops_count Childcare centers_count
Example Name 1 13.0 251 87
Example Name 2 14.0 300 60
I'm guessing this is like the opposite of a dplyr melt, but I'm not sure how to do it.