Good afternoon colleagues,
Presently, I am working on a movies dataset, sample provided below;
A tibble: 5 x 3 content_rating gross_income imdb_score <chr> <dbl> <dbl> 1 PG 200 6.5 2 PG 207 7 3 PG 209 8 4 PG-13 105 9 5 PG-13 110 4.5
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;
ggplot(movie_select ,aes(gross_income,imdb_score))+ geom_point()+ facet_wrap(~content_rating)
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.