R: how to sample rows with custom frequencies : <p>I have a data frame in R that has two columns, one with last names, the other with the frequency of each last name. I would like to randomly select last names based on the frequency values (0 -> 1).</p>

<p>So far I have tried using the sample function, but it doesn't allow for specific frequencies for each value. Not sure if this is possible :/</p>
