bio-data-visualization-ggplot2-fundamentals
Installation
SKILL.md
Version Compatibility
Reference examples tested with: ggplot2 3.5+
Before using code patterns, verify installed versions match. If versions differ:
- R:
packageVersion('<pkg>')then?function_nameto verify parameters
If code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.
ggplot2 Fundamentals
"Create a publication-quality plot in R" → Build layered graphics using ggplot2's grammar of graphics (data + aesthetics + geometry + theme).
- R:
ggplot(data, aes(x, y)) + geom_point() + theme_classic()
Basic Structure
library(ggplot2)