Primary exercises
Necessary libraries and data.
In your R Markdown document load thetidyverse
library and read thepulse.csv
file into thepulse
variable.A series of charts.
Reproduce the sequence of charts.
Each next chart is a small modification of the command.
ggplot( pulse, aes( x = age, y = weight ) ) +
geom_point()
ggplot( pulse, aes( x = age, y = weight ) ) +
geom_point( aes( color = exercise ) )
ggplot( pulse, aes( x = age, y = weight ) ) +
geom_point( aes( color = exercise ), alpha = 0.6 )
ggplot( pulse, aes( x = age, y = weight ) ) +
geom_point( aes( color = exercise, shape = gender ), alpha = 0.6 )
ggplot( pulse, aes( x = age, y = weight ) ) +
geom_point( aes( color = exercise, shape = gender ), alpha = 0.6, size = 3 )
- Labels.
CheckHelp
for commandsxlab
,ylab
,ggtitle
.
Adjust the last chart to get the chart below.
ggplot( pulse, aes( x = age, y = weight ) ) +
geom_point( aes( color = exercise, shape = gender ), alpha = 0.6, size = 3 ) +
xlab( "Age [years]" ) + ylab( "Weight [kg]" ) +
ggtitle( "All subjects from pulse.csv" )