Types of visualizations Flashcards
(7 cards)
What is the recipe to create a line plot?
ggplot(…) + geom_line()
Ex: ggplot(my_tibble, aes(x = gdpPerCap, y = lifeExp)) + geom_line()
What is the recipe to create a bar plot?
ggplot(…) + geom_col()
Ex: ggplot(my_tibble, aes(x = continent, y = lifeExp)) + geom_col()
What is the recipe to create a histogram?
ggplot(…) + geom_histogram()
Ex: ggplot(my_tibble, aes(x = gdpPerCap)) + geom_histogram()
How can you change the width of bins in a histogram?
By using the binwidth variable.
Ex: geom_histogram(binwidth = 5)
How can you set the number of bins?
By using the bins variable.
Ex: geom_histogram(bins = 30)
What is the recipe to create a boxplot?
ggplot(…) + geom_boxplot()
Ex: ggplot(my_tibble, aes(x = continent, y = lifeExp)) + geom_boxplot()
What is the black line in the middle of each box in a box plot?
What are the top and bottom of each box?
What are the whiskers of each box?
What do dots outside the whiskers represent?
The median.
The 75th and 25th percentile of the distribution. 50% of the distribution lies within the box.
The whiskers go down to the minimum and up to the maximum, excluding outliers.
Outliers.