Data visualization Flashcards

(8 cards)

1
Q

Which library is critical for creating visualizations such as scatterplots in R?

A

ggplot2

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

What is the recipe to create a scatterplot?

A

ggplot(…) + geom_point()

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

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

What are the three parts of a ggplot graph?

A
  1. The data that we’re visualizing.
    Ex: ggplot(my_tibble…
  2. The mapping of variables in your dataset to aesthetics in your graph.
    Ex: …aes(x = gdpPerCap, y = lifeExp))…
  3. Specifying the type of graph you’re creating.
    Ex: … + geom_point()
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is an aesthetic?

A

A visual dimension of a graph that can be used to communicate information.

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

How can you make a scatter plot logarithmic?

A

scale_x_log10() or scale_y_log10()

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

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

What aesthetic options are available in scatter plots?

A

x, y, color, size

Ex: aes(x = thing1, y = thing2, color = thing3, size = thing4)

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

What is faceting?

A

Splitting one graph into many graphs based on a categorical variable.

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

What is the function to facet a graph based on a certain variable?

A

facet_wrap()

Ex: … geom_point() +
facet_wrap(~ continent)

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