title: Matching the distribution of a modeled data set to that of an observed data set?
body: <p>I have two data sets. Let's assume they look like this for simplicity:</p>
  
  <pre><code>observed &lt;- data.frame(name = c("Jenny", "Mark", "James", "Amber", "Jamie"),
                     height = c(68, 69, 72, 63, 77), 
                     mood = c("content", "content", "melancholy", "happy", "melancholy"))
  modeled &lt;- data.frame(name = c("Alex", "Jimmy", "Sal", "Evelyn", "Maria", "George", "Hilary", "Donny", "Jose", "Luke", "Leia"),
                    height = c(74, 71, 68, 66, 80, 59, 67, 67, 69, 65, 72), 
                    mood = c("content", "content", "melancholy", "happy", "melancholy","content", "content", "melancholy", "happy", "melancholy", "happy"))
  </code></pre>
  
  <p>I'd like to select rows from modeled such that that the distribution of modeled$heights is as close as possible to the distribution of observed$heights. I need to keep the rows intact rather than simply matching the distribution of the height integers. Any insight would be much appreciated.</p>