I'm looking to create a set of box plots where I create a bloxplot for each variable in sampledf1 against the single variable in sampledf2.
The actual use case is I've created a set of clusters with k-means and now want to see their distribution for each of the found clusters with each variable in the dataframe I'm using for clustering.
sampledf1 <- as.data.frame(replicate(6, sample(c(1:10,NA))))
sampledf2 <- as.data.frame(replicate(1, sample(c(21:30,NA))))
Then I want to see a box plot with each of the variables in sampledf1 paired with the only variable in sampledf2.
I would like to use something like:
sapply(boxplot(sampledf1~sampledf2$V1))
but this gives me this error:
Error in match.fun(FUN) : argument "FUN" is missing, with no default
Anyway I could do this would dplyr would be great but I didn't see any functions that I could chain together to do this.



