Again, we are using the palmerpenguins
package, as well
as the ggplot2
package. Since ggplot2
is part
of the tidyverse, you can just load the entire tidyverse
again. Last, load the cowplot
packages to combine
plots.
# Insert code here
# End
Take either the penguins
or the
penguins_raw
data set and create a scatterplot using two
continuous variables. Make sure to format the axis titles and add a
figure title.
# Insert code here
# End
Next, change, the overall theme, use a different point shape, size and point color.
# Insert code here
# End
Next, use at least one of the discrete variables in the data set and use it to a) set different point colors based on the discrete variable and b) wrap the plot using facets. Try to use different colors than the default color scheme.
# Insert code here
# End
# Insert code here
# End
Try to make a histogram of the bill depth separated by species and
sex. You can use colors, fills, facets or any other idea you have to
separate the discrete classes. Try out different bin widths and see how
much the plots changes. Last, can you add a density curve to the
histogram? To compare the bin widths, combine at least two different
plots to one (using cowplot
)
# Insert code here
# End
Visualize the body mass of all species using a boxplot. Additionally, to the boxplot, also add the raw data distribution (as points), the number of individuals for each species (as text) and some information about the sex differences (however you want).
# Insert code here
# End
Summarize the penguins
data set by two discrete
variables and calculate the mean flipper length. Create a plot showing
the mean length for the two groups including an error measure (e.g.,
mean +/- sd).
# Insert code here
# End