R · Visualization
Create a bar chart from frequencies
Work with the mini survey and compare your output with the expected result.
Mini exercises · Practice with data ↓
Try it in three steps
- Extract the mini exercise package below. Complete the cleaning task or use anket-temiz.csv. No extra R package is required.
- Work in the data folder and load the data: df <- read.csv("anket-temiz.csv", na.strings="")
- Run: barplot(table(factor(df$transport, levels=c("bus", "walk", "bike"))), ylim=c(0,12), ylab="Participants", main="Synthetic survey (n=20)")
How to read the output
bus=10, walk=6, bike=4. The vertical axis counts participants; percentages are 50%, 30%, 20%.
Test your understanding.
True or false?
These synthetic data establish conclusions about a real population.
Related concepts
Official source
R · Documentation ↗Documentation checked: . Steps are based on official documentation and have not been tested in the application. Menu names may differ by version and interface language.