Primary exercises

  1. Necessary libraries and data.
    In your R Markdown document load the tidyverse library and read the pulse.csv file into the pulse variable.

  2. A series of charts.
    Reproduce the sequence of charts.
    Each next chart is a small modification of the command.

  1. Labels.
    Check Help for commands xlab, ylab, ggtitle.
    Adjust the last chart to get the chart below.

Extra exercises

  1. Multiple layers.
    There can be more than one geom_ component in a single plot.
    Compose two geom_point components (so, add one more than used above) to reproduce the following chart.

  2. Different data in layers.
    By default, geom_ functions use the data provided in the call to the ggplot function.
    This can be changed with the data argument: geom_point( data = otherData ).

    Use the function filter to select from pulse all subjects with height >= 190; store the result in filtPulse. Now, modify the previous plot to draw the black symbol only for filtPulse subjects.



Copyright © 2022 Biomedical Data Sciences (BDS) | LUMC