Types of visualizations Flashcards

(7 cards)

1
Q

What is the recipe to create a line plot?

A

ggplot(…) + geom_line()

Ex: ggplot(my_tibble, aes(x = gdpPerCap, y = lifeExp)) + geom_line()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the recipe to create a bar plot?

A

ggplot(…) + geom_col()

Ex: ggplot(my_tibble, aes(x = continent, y = lifeExp)) + geom_col()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the recipe to create a histogram?

A

ggplot(…) + geom_histogram()

Ex: ggplot(my_tibble, aes(x = gdpPerCap)) + geom_histogram()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How can you change the width of bins in a histogram?

A

By using the binwidth variable.

Ex: geom_histogram(binwidth = 5)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How can you set the number of bins?

A

By using the bins variable.

Ex: geom_histogram(bins = 30)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the recipe to create a boxplot?

A

ggplot(…) + geom_boxplot()

Ex: ggplot(my_tibble, aes(x = continent, y = lifeExp)) + geom_boxplot()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

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?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly