Creating Basic Charts with ggplot2
Table 1
Table
6 / 11
Table 1
Table
Table 1
| Chart type | `ggplot2` geometry | Suitable clinical data use |
|---|---|---|
| Bar chart | `geom_bar()` or `geom_col()` | Counts by site, category, query status |
| Histogram | `geom_histogram()` | Numeric distribution such as age or lab values |
| Box plot | `geom_boxplot()` | Numeric values by site or treatment group |
| Line chart | `geom_line()` | Enrollment over time |
| Scatter plot | `geom_point()` | Relationship between two numeric variables |
| Faceted chart | `facet_wrap()` | Same chart repeated by site, visit, or group |