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

bookChallenge: Create Your First Plots

Tarefa

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.

Solução

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 1. Capítulo 2
single

single

Pergunte à IA

expand

Pergunte à IA

ChatGPT

Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo

close

bookChallenge: Create Your First Plots

Deslize para mostrar o menu

Tarefa

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.

Solução

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 1. Capítulo 2
single

single

some-alt