Marketing Data Visualisation in R: Choosing Charts That Answer the Question
Learn how to clean marketing data and create honest, readable visualisations in R with ggplot2 for comparisons, trends, distributions and relationships.
A chart is effective when a reader can identify the intended comparison and interpret it correctly. Marketing datasets often include sales, campaign, customer and product variables, creating many possible visuals but only a few that answer a specific question well.
This guide explains a question-first workflow using R and ggplot2.
What you will learn
- Begin with an analytical question.
- Match the chart to the comparison.
- Use scales and labels honestly.
- Show uncertainty and sample size where relevant.
- Design for readability before decoration.
1. Convert the request into a chart question
- Comparison: which category is larger or smaller?
- Trend: how does a measure change over time?
- Distribution: how are values spread?
- Relationship: do two measures move together?
- Composition: how is a total divided?
- Geography: where are values concentrated?
2. Prepare tidy data
Each variable should have a consistent meaning and unit. Check date parsing, duplicated records, category labels and whether measures are totals, averages or rates.
Aggregation changes the question. A chart of total sales by category can reflect category size, whereas average sale per order answers a different question.
3. Select a suitable chart
- Sorted bar chart for category comparisons.
- Line chart for ordered time trends.
- Histogram or density plot for distributions.
- Box plot for comparing distributions across groups.
- Scatter plot for relationships between continuous variables.
- Map only when location itself matters.
4. Use colour and scales carefully
Use colour to encode meaning, not to decorate every element. Keep category colours consistent across figures and use palettes that remain distinguishable for readers with colour-vision deficiencies.
Bar charts generally require a zero baseline. Truncated axes can exaggerate small differences. Log scales can be appropriate but must be labelled and explained.
5. Add context
- Descriptive title that states the finding or question.
- Axis labels with units.
- Time period and population.
- Source or data note.
- Sample sizes or uncertainty where needed.
- Annotation for a small number of important events.
6. Export reproducibly
Use a script to clean, summarise and plot so the figure can be recreated. Export at dimensions suitable for the report or website rather than relying on screenshots.
Review the final image at its actual display size.
NEED HELP WITH YOUR ASSIGNMENT?
Submit your assignment instructions for private support.
Frequently asked questions
When should a pie chart be used?
Only for a small number of parts that form a meaningful whole and where precise comparison is not essential. A bar chart is often clearer.
Should every chart have a zero baseline?
Bars should usually start at zero because length encodes value. Line and scatter plots may use other ranges when clearly labelled and not misleading.
Why are averages sometimes misleading?
Averages can hide variation, skewness, unequal group sizes and outliers. Add distributions or uncertainty when those features matter.
What makes a chart reproducible?
The data preparation, summary and plotting steps are saved as code with documented inputs and settings.