Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda Introduction to ggplot2 | Data Visualization
Data Analysis with R

bookIntroduction to ggplot2

ggplot2 is part of the tidyverse collection of R packages. It's used to create powerful, layered, and customizable data visualizations.

To use it, load the libraries:

library(tidyverse)
library(ggplot2)

Disable scientific notation to make plots more readable:

options(scipen = 999)

Read the dataset:

df <- read_csv("car_details.csv")
View(df)

Basic Structure of a ggplot2 Plot

Every ggplot2 visualization is constructed in layers:

ggplot(data, aes(x, y)) + geom_function()
  • data: the dataset being used.

  • aes(): aesthetic mapping (e.g., x and y axes).

  • geom_*(): geometry layer that decides how the data should appear (e.g., bars, points, lines).

Summary

question mark

What is the purpose of the aes() function in ggplot2?

Select the correct answer

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 2. Capítulo 1

Pergunte à IA

expand

Pergunte à IA

ChatGPT

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

Awesome!

Completion rate improved to 4

bookIntroduction to ggplot2

Deslize para mostrar o menu

ggplot2 is part of the tidyverse collection of R packages. It's used to create powerful, layered, and customizable data visualizations.

To use it, load the libraries:

library(tidyverse)
library(ggplot2)

Disable scientific notation to make plots more readable:

options(scipen = 999)

Read the dataset:

df <- read_csv("car_details.csv")
View(df)

Basic Structure of a ggplot2 Plot

Every ggplot2 visualization is constructed in layers:

ggplot(data, aes(x, y)) + geom_function()
  • data: the dataset being used.

  • aes(): aesthetic mapping (e.g., x and y axes).

  • geom_*(): geometry layer that decides how the data should appear (e.g., bars, points, lines).

Summary

question mark

What is the purpose of the aes() function in ggplot2?

Select the correct answer

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 2. Capítulo 1
some-alt