Creating a lift chart in R
<p>Suppose I have the following data frame consisting of people with some score associated with them:</p>

<pre><code>Score | hasDefaulted
10    | 0
13    | 0
15    | 1
17    | 0
...
</code></pre>

<p>I want to make a lift chart in R by first sorting the population by score, then having % of population on the X-axis, and % of Default's on the Y-axis. I cannot find a good package that gives me the control to do this. I have explored <a href="https://cran.r-project.org/web/packages/lift/lift.pdf" rel="nofollow noreferrer">Package Lift</a> as well as <a href="https://cran.r-project.org/web/packages/gains/gains.pdf" rel="nofollow noreferrer">Package Gains</a> but I cannot figure out how to get enough control over them to do what I described above. For example, when I try using Package Lift, as</p>

<pre><code>plotLift(sort(dataFrame$Score, decreasing=FALSE), dataFrame$hasDefaulted)
</code></pre>

<p>I get some strange plot:<a href="https://i.stack.imgur.com/Vh7Hm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Vh7Hm.png" alt=""></a></p>

<p>But given my desires, the plot should end up looking like a cumulative density function.</p>

<p>Could someone show me how to use such packages properly, or direct me to a package that does the required? Thanks in advance.</p>