So I am calculating the percentiles of data in a data frame by using the ecdf function. Like this:
dataFrame$percentiles <- ecdf(dataFrame$data)(dataFrame$data)
Now, I want to find what would be the value of the data at a specific percentile and create a column of data values based off of percentiles.
dataFrame$dataFromPercentiles <- SOMEFUNCTION(dataFrame$data, dataFrame$percentiles)
In this example, the dataFrame$data and dataFrame$dataFromPercentiles should be exactly the same. This is what I want to happen. I have attempted to use the quartile function but I cannot seem to get it to return one value.