Anand Lakshmanan (consulting requests : @lan24hd)
Height data of a family:
120,110,170,180,176,171,101 cms.
Your job is to select t-shirt sizes for them.
How many small t-shirts and how many large t-shirts ?
What else can we infer about this family ?
“Visualizations can surprise you !” - Hadley Wickham
3 small children, 2 parents, and 2 grandparents.
Therefore: 3 small t-shirts and 4 large t-shirts!
| name | height |
|---|---|
| Anil | 120 |
| Bobby | 110 |
| Manju | 170 |
| Rekha | 180 |
| Peter | 176 |
| Rohit | 171 |
| Ananya | 101 |
Grandparents live in TN; parents and children live in KA!
Children like soccer !
library(tidyverse)
height_data <- data_frame(name = c("Anil","Bobby","Manju","Rekha",
"Peter","Rohit","Ananya"),
height = c(120,110,170,180,176,171,101))
kable(height_data)
height_data %>% ggplot(aes(height)) + geom_bar() +
theme_minimal() + theme(axis.title = element_text(size = 20))
height_data %>% ggplot(aes(name,height)) + geom_point(size = 20) +
theme_minimal() + theme(axis.title = element_text(size = 20))
height_data <- height_data %>%
mutate(state = c("KA","KA","TN","KA","KA","TN","KA"))
height_data %>% ggplot(aes(name,height, color = state)) + geom_point(size = 20) +
theme_minimal() + theme(axis.title = element_text(size = 20))
height_data <- height_data %>%
mutate(favorite_sport = c("Soccer","Soccer","Cricket","Hockey",
"Soccer","Hockey","Soccer"))
height_data %>% ggplot(aes(name,height, color = state, shape = favorite_sport)) +
geom_point(size = 20) +
theme_minimal() + theme(axis.title = element_text(size = 20))