Recall & Review
beginner
What is a color palette in R?
A color palette in R is a set of colors used together to make plots or graphics look nice and clear. It helps to keep colors consistent and visually appealing.
Click to reveal answer
beginner
How do you create a simple color palette using base R?
You can create a simple color palette using the
palette() function, for example: palette(c("red", "green", "blue")) sets the palette to red, green, and blue.Click to reveal answer
intermediate
What is the purpose of the
colorRampPalette() function?colorRampPalette() creates a function that generates a smooth gradient of colors between given colors. You can use it to make many colors blending from one to another.Click to reveal answer
beginner
Name two popular R packages for advanced color palettes.
Two popular R packages for color palettes are
RColorBrewer and viridis. They provide many ready-to-use palettes for different purposes.Click to reveal answer
intermediate
What is the difference between sequential and diverging color scales?
Sequential color scales show a progression from light to dark or low to high values, good for ordered data. Diverging scales have two contrasting colors meeting in the middle, useful for showing deviation from a midpoint.
Click to reveal answer
Which function in base R creates a smooth gradient of colors?
✗ Incorrect
colorRampPalette() creates a function that generates gradients between colors.Which package provides the
brewer.pal() function for palettes?✗ Incorrect
brewer.pal() is from the RColorBrewer package.What type of data is best visualized with a diverging color scale?
✗ Incorrect
Diverging scales highlight differences from a midpoint, like zero or average.
Which function sets the current color palette in base R?
✗ Incorrect
palette() sets or gets the current color palette.The
viridis package is known for palettes that are:✗ Incorrect
viridis palettes are designed to be easy to read by everyone, including colorblind people.Explain how to create and use a custom color palette in R using base functions.
Think about how you tell R which colors to use and then use them in a plot.
You got /3 concepts.
Describe the difference between sequential and diverging color scales and when to use each.
Consider how colors change and what the data represents.
You got /3 concepts.