Multiple Choices: ggplot2(Scatter Plot)

  1. Which of the following code snippets correctly creates a scatter plot with Sepal.Length on the x-axis and Sepal.Width on the y-axis from the iris dataset? ::: {.cell}
  1. To color points in a scatter plot by the Species variable in the iris dataset, which code should you use? ::: {.cell}

:::

  1. How would you set the size of all points in a scatter plot to 3? ::: {.cell}

:::

  1. Which argument in geom_point() can be used to make the points semi-transparent? ::: {.cell}

:::

  1. To add a regression line to a scatter plot, which layer should you add to geom_point()? ::: {.cell}

:::

  1. If you want to limit the x-axis in a scatter plot to a range between 4 and 8, which code should you use? ::: {.cell}

:::

  1. Which of the following would change the shape of points in a scatter plot? ::: {.cell}

:::

  1. To display both color and size based on the variable Petal.Length, which code should you use in a scatter plot? ::: {.cell}

:::

  1. Which function is used to add custom axis labels to a scatter plot? ::: {.cell}

:::

  1. To add a title to the scatter plot, which function should be used? ::: {.cell}

:::

  1. Which of the following code snippets would set the color of all points in the scatter plot to blue? ::: {.cell}

:::

  1. To plot points with jitter (slight random noise to reduce overlap), which function should you use? ::: {.cell}

:::

  1. Which function allows you to change the x-axis and y-axis scales to logarithmic in a scatter plot? ::: {.cell}

:::

  1. If you want to add labels to each point in a scatter plot using the Species variable, which function should you add? ::: {.cell}

:::

  1. To control the color gradient of points based on a continuous variable (e.g., Petal.Width), which function should you use? ::: {.cell}

:::

  1. To apply a custom theme with a dark background and white grid lines, which theme function should you use? ::: {.cell}

:::

  1. How would you add a legend title for the color aesthetic? ::: {.cell}

:::

  1. If you want to highlight certain points with a specific color, which of the following code snippets would accomplish this if the highlight variable indicates points to be highlighted? ::: {.cell}

:::

  1. To adjust the space between axis ticks and labels, which function should you modify? ::: {.cell}

:::

  1. Which code snippet would set both the x-axis and y-axis limits to range between 0 and 10? ::: {.cell}

:::

  1. How would you add a 95% confidence interval to a regression line in a scatter plot? ::: {.cell}

:::

  1. To vary point size based on the values of a continuous variable Weight, which of the following code snippets is correct? ::: {.cell}

:::

  1. Which function allows you to save a ggplot scatter plot as an image file? ::: {.cell}

:::

  1. To add a caption below a scatter plot, which of the following should you use? ::: {.cell}

:::

  1. Which code snippet allows you to change both the x-axis and y-axis labels’ font size to 14? ::: {.cell}

:::

  1. To create a facet grid of scatter plots based on two categorical variables, Type and Category, which function should be used? ::: {.cell}

:::

  1. If you want to adjust the transparency of the confidence interval around a geom_smooth() line, which argument should you modify? ::: {.cell}

:::

  1. To display a smooth line but without the points in a scatter plot, which of the following codes should you use? ::: {.cell}

:::

  1. Which function would you use to apply a color scale for a continuous variable, Petal.Length, using the viridis palette? ::: {.cell}

:::

  1. To create a scatter plot with a background panel color of light gray, which code would be appropriate? ::: {.cell}

:::

:::