CENTRO UNIVERSITÁRIO CELSO LISBOA

MATERIA: ANÁLISE DE DADOS

#AUTOR: THIAGO DA SILVA MEIRELES

library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(ggplot2)      

GRAFICO DE PONTOS

ggplot(storms) +
  aes(year, wind) +
  geom_point()

# GRAFICO DE COLUNAS

ggplot(storms) +
  aes(year, wind, color = year) +
  geom_col() 

# GRÁFICO DE BARRAS

ggplot(storms) +
  aes(wind) +
    geom_bar(color = "blue", fill = "yellow") 

# GRÁFICO DE LINHA

storms_processado <- storms %>%
  group_by(month) %>%
  summarise(media_pressao = mean(pressure, na.rm = TRUE))
print(storms_processado)
## # A tibble: 10 × 2
##    month media_pressao
##    <dbl>         <dbl>
##  1     1          992.
##  2     4          998.
##  3     5         1004.
##  4     6         1002.
##  5     7         1001.
##  6     8          996.
##  7     9          990.
##  8    10          991.
##  9    11          992.
## 10    12          998.
ggplot(storms_processado) +
  aes(x = month, y = media_pressao) +
  geom_line(color = "steelblue", size = 1)
## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
## ℹ Please use `linewidth` instead.
## This warning is displayed once per session.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.

# HISTOGRAMA

ggplot(storms) +
    aes(wind) +
    geom_histogram(bins = 15, color = "green", fill = "white")