## load sample data
ndi_m <- dep_sample_data(index = "ndi_m")
# calculate percentiles for population 25 years and older
ndi_m <- dep_percentiles(ndi_m, source_var = B06009_001E,
new_var = pop25_percentile)
# preview the new data
ndi_m[names(ndi_m) %in% c("GEOID", "B06009_001E", "pop25_percentile")]
Run the code above in your browser using DataLab