0

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.

CodedGames
  • 11
  • 2
  • 1
    Your question could be a wasted effort if you do not make it reproducible for others. You may want to read: [how-to-make-a-great-r-reproducible-example](https://stackoverflow.com/a/5963610/6574038) – jay.sf Jun 01 '20 at 05:22
  • 1
    +1 for @jay.sf. It woiuld also help to have an example of your expected output based on a specific input. – Limey Jun 01 '20 at 07:01
  • I have updated the question to better explain what I want to do in a simpler way. Basically I want an inverse of the "ecdf" function. One that I can take a dataFrame and get the value of a specific percentile. I have attempted to use the quartile function but cannot get it to return data in a what to create a column in a data frame. – CodedGames Jun 01 '20 at 20:47

0 Answers0