I have two data frames Name_List and Fruits_List. I would like to produce the dataframe Output. Output in such a way that Name should repeat based on the values in Rows_to_repeat column. Please let me know if anyone has the solution.
Name=c("rohit","murali","partha")
Rows_to_repeat=c(6,3,1)
Fruits=c("Apple","Orange","Watermelon","Mango","Banana","Kiwi","Pomo","Dates","Muskmelon","Papaya")
Person_Got_Fruit=c("rohit","rohit","rohit","rohit","rohit","rohit","murali","murali","murali","partha")
Name_List=data.frame(Name,Rows_to_repeat)
Fruits_List=data.frame(Fruits)
Output=data.frame(Fruits,Person_Got_Fruit)
This is the Solution which is working for me