Create elegant statistical visualizations in R using ggplot2 grammar of graphics.
Build visualizations using ggplot2 in R: Data Context: - Dataset: [name or describe structure] - Variables: [list with types] - Sample size: [rows] - Source: [built-in/CSV/database] Visualization Requirements: 1. Aesthetic Mappings - x: [variable] - y: [variable] - color/fill: [variable, discrete/continuous] - size: [variable if applicable] - shape: [variable if applicable] - linetype: [variable if applicable] 2. Geometries - Primary: [point/line/bar/boxplot/etc.] - Secondary: [overlay if needed] - Statistical transformations 3. Faceting - facet_wrap: [formula] - facet_grid: [formula] - Free scales: [yes/no] - Labeling: [custom labels] 4. Scale Customization - Color: [palette/manual/gradient] - Axis: [limits, breaks, labels] - Transforms: [log/sqrt/reverse] 5. Theme Customization - Base theme: [minimal/classic/bw/custom] - Text elements: [sizes, faces] - Legend position - Panel styling - Grid lines 6. Annotations - Title and subtitle - Caption - Axis labels - Text annotations - Reference lines 7. Extensions - ggrepel: [for labels] - patchwork: [for combining] - gganimate: [for animation] - plotly: [for interactivity] Output: - ggsave specifications - Size for publication - Multi-page output Provide complete R code with pipe-friendly workflow.
Or press ⌘C to copy