The goal is to create a scatter plot facetted by the content rating variable, as well as get the correlation coefficient for each plot in the top right of individual scatter plots. Here is my attempt so far;
But I am not sure how to add the code that will display the corresponding correlation coefficient in the top right of each scatter plot. Help is appreciated.
I'm gonna do a cheeky plug here and put out a link to my own package, stickylabeller, which makes this stuff a little easier. There's a section in the README on adding summary statistics to the facet labels—basically, I recommend creating a summary data frame with the correlations and then joining it back to your original data.
If you're feeling brave, this feature branch also allows you to create facet strips that are overlaid on the facets, in case you want something less like a label strip and more like text overlaid on the plot.