Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Challenge: Create Your First Plots | Getting Started with Data Visualization in R
Visualization and Reporting with R

bookChallenge: Create Your First Plots

Tâche

Swipe to start coding

Create a 2x2 grid of plots using the ggplot2 package and the provided data frames. Each plot in the grid should be different and use the appropriate ggplot2 geometry for the data:

  • Create a bar plot of data1, showing category on the x-axis and value on the y-axis.
  • Create a line plot of data2, plotting x versus y.
  • Create a scatter plot of data3, plotting x versus y, colored by group.
  • Leave the fourth slot in the grid empty.
  • Arrange the three plots in a 2x2 grid using a suitable function (such as gridExtra::grid.arrange or patchwork).

You may need to install and load additional packages for arranging multiple plots. Do not repeat code or plot types already shown in the chapter examples.

Solution

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 1. Chapitre 2
single

single

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

close

bookChallenge: Create Your First Plots

Glissez pour afficher le menu

Tâche

Swipe to start coding

Create a 2x2 grid of plots using the ggplot2 package and the provided data frames. Each plot in the grid should be different and use the appropriate ggplot2 geometry for the data:

  • Create a bar plot of data1, showing category on the x-axis and value on the y-axis.
  • Create a line plot of data2, plotting x versus y.
  • Create a scatter plot of data3, plotting x versus y, colored by group.
  • Leave the fourth slot in the grid empty.
  • Arrange the three plots in a 2x2 grid using a suitable function (such as gridExtra::grid.arrange or patchwork).

You may need to install and load additional packages for arranging multiple plots. Do not repeat code or plot types already shown in the chapter examples.

Solution

Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 1. Chapitre 2
single

single

some-alt