title: Assign Names based on total in r
body: <p>I have two dataframes in which first data frame is <strong>Problems</strong> it has problem number and number of problem to be solved, second data frame is <strong>Name_Data</strong> it is having name of the person who will solve the problems and days for which he can work. I need the resulting data frame such as based on total person and days availability, problem list will be assigned to each person. Problem_Solver_Name has to be assigned equally by calculating total problems divided by days availability of problem solver. Problem_with_Solver is my resulting data frame.</p>
  <p>Please help if anybody has the solution for this</p>
  <pre><code>Name=c(&quot;Antony&quot;,&quot;Roger&quot;,&quot;Peter&quot;,&quot;Samuel&quot;)
  Days=c(1,1,0.5,1)
  Name_Data=data.frame(Name,Days)
  
  Problem_List=c(&quot;Problem1&quot;,&quot;Problem2&quot;,&quot;Problem3&quot;,&quot;Problem4&quot;,&quot;Problem5&quot;,&quot;Problem6&quot;,&quot;Problem7&quot;,&quot;Problem8&quot;,
                 &quot;Problem9&quot;,&quot;Problem10&quot;,&quot;Problem11&quot;,&quot;Problem12&quot;,&quot;Problem13&quot;,&quot;Problem14&quot;,&quot;Problem15&quot;,&quot;Problem16&quot;,
                 &quot;Problem17&quot;,&quot;Problem18&quot;,&quot;Problem19&quot;)
  Total_Problem=c(1,2,3,4,5,6,8,9,10,11,12,13,14,15,16,18,19,20,21)
  Problems=data.frame(Problem_List,Total_Problem)
  
  Problem_Solver_Name=c(&quot;Antony&quot;,&quot;Antony&quot;,&quot;Antony&quot;,&quot;Antony&quot;,&quot;Antony&quot;,&quot;Antony&quot;,&quot;Roger&quot;,&quot;Roger&quot;,&quot;Roger&quot;,&quot;Roger&quot;,&quot;Roger&quot;,&quot;Peter&quot;,&quot;Peter&quot;,&quot;Peter&quot;,&quot;Samuel&quot;,&quot;Samuel&quot;,&quot;Samuel&quot;,&quot;Samuel&quot;,&quot;Samuel&quot;)
  Problem_with_Solver=data.frame(Problem_List,Total_Problem,Problem_Solver_Name)
  </code></pre>