I need help creating a way of sorting a column in R so that I can plot household rank by consumption per capita. I have a column with all of the consumption per capita which will go on the y-axis and then need to put their "rank" on the x-axis from [0,1] separated by .1. I have 4200 consumption per capita data points so everyone from [1,420] should go in the first .1 percentile and so on.
rank<-dplyr::ntile(cpc,1000)
(cpc is your consumption per capita vector). This will separate your vector into 1000 buckets of 0.1% each.