Making faceted scatterplots
It's not hard to figure out how a faceted scatterplot can be drawn using the previous recipe just by skipping one single function (geom_smooth()
). Nonetheless, this recipe is sailing outer seas while investigating heights (centimeters) and weights (kilos) coming from Australian athletes of different sports and categories.
In order to accomplish this, we're relying on the DAAG::ais
data set. To avoid the excess of information, the analysis is narrowed, contemplating a few sports only, not all the ones present in this data frame.Â
Getting ready
Look out for the DAAG
package:
> if( !require(DAAG)){ install.packages('DAAG')}
Once it's installed, the recipe can go on.
How to do it...
Let us start with making faceted scatterplot:
- Store the data frame in a new variable and narrow it down:
> data_sport <- DAAG::ais > sports <- c('B_Ball','Field','Row','T_400m') > data_sport <- data_sport[data_sport$sport %in% sports,]
- Draw a scatterplot as usual and sum the...