I am wondering whether there is an opportunity for choosing random names with some conditions. I read about diffierent random functions from random package, but they choose only one number randomly. I also thought about function, but did not come up with idea how to write it properly.
I have a table with many columns (~15) and I need to choose some random names (no exact number) which total sum is less than or equal 500. Hence, here I need to get two names AQ2 and COR and then I will extract other information from the table.
name sum city
AQ2 400 N
L3K 50 L
COR 100 Q
… … …
Could you, please, advise me how to perform it?
Thank you in advance!