If I have 2 datasets (in the example below names and car companies) how to I get R/Rstudio to randomly pair an item from each dataset?
I don't want Jack to always be selected with Kia, I want R to randomly pick a car company for Jack.
d <- data.frame( name = c("bob", "jack", "carl", "jill"),
site = c("honda", "kia", "ford", "toyota"))
sample_n(d, 2)
sample_n(d, 2)
name site
1 jack kia
2 jill toyota