Passo 1 - Carregar a base de dados

load("C:/Users/Liana/Desktop/Base_de_dados-master/df_pokemon.RData")

Passo 2 - Inspencionar os dados

summary(df)
##        id          pokemon            species_id        height      
##  Min.   :  1.0   Length:718         Min.   :  1.0   Min.   :  1.00  
##  1st Qu.:180.2   Class :character   1st Qu.:180.2   1st Qu.:  6.00  
##  Median :359.5   Mode  :character   Median :359.5   Median : 10.00  
##  Mean   :359.5                      Mean   :359.5   Mean   : 11.41  
##  3rd Qu.:538.8                      3rd Qu.:538.8   3rd Qu.: 14.00  
##  Max.   :718.0                      Max.   :718.0   Max.   :145.00  
##      weight       base_experience     type_1             type_2         
##  Min.   :   1.0   Min.   : 36.00   Length:718         Length:718        
##  1st Qu.:  95.0   1st Qu.: 65.25   Class :character   Class :character  
##  Median : 280.0   Median :147.00   Mode  :character   Mode  :character  
##  Mean   : 568.2   Mean   :141.55                                        
##  3rd Qu.: 609.5   3rd Qu.:177.00                                        
##  Max.   :9500.0   Max.   :608.00                                        
##      attack          defense             hp         special_attack  
##  Min.   :  5.00   Min.   :  5.00   Min.   :  1.00   Min.   : 10.00  
##  1st Qu.: 53.00   1st Qu.: 50.00   1st Qu.: 50.00   1st Qu.: 45.00  
##  Median : 73.00   Median : 65.00   Median : 65.00   Median : 65.00  
##  Mean   : 74.85   Mean   : 70.67   Mean   : 68.37   Mean   : 68.47  
##  3rd Qu.: 95.00   3rd Qu.: 85.00   3rd Qu.: 80.00   3rd Qu.: 90.00  
##  Max.   :165.00   Max.   :230.00   Max.   :255.00   Max.   :154.00  
##  special_defense      speed          color_1            color_2         
##  Min.   : 20.00   Min.   :  5.00   Length:718         Length:718        
##  1st Qu.: 50.00   1st Qu.: 45.00   Class :character   Class :character  
##  Median : 65.00   Median : 65.00   Mode  :character   Mode  :character  
##  Mean   : 69.09   Mean   : 65.72                                        
##  3rd Qu.: 85.00   3rd Qu.: 85.00                                        
##  Max.   :230.00   Max.   :160.00                                        
##    color_f          egg_group_1        egg_group_2         url_image        
##  Length:718         Length:718         Length:718         Length:718        
##  Class :character   Class :character   Class :character   Class :character  
##  Mode  :character   Mode  :character   Mode  :character   Mode  :character  
##                                                                             
##                                                                             
##                                                                             
##        x                 y          
##  Min.   :-49.152   Min.   :-45.793  
##  1st Qu.:-17.695   1st Qu.:-17.293  
##  Median :  0.705   Median : -0.628  
##  Mean   :  0.000   Mean   :  0.000  
##  3rd Qu.: 15.905   3rd Qu.: 18.155  
##  Max.   : 53.142   Max.   : 46.593
var(df$height)
## [1] 106.501
sd(df$height)
## [1] 10.31993

Passo 3 - carregar biblioteca de dados

library(flextable)
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(reactable)

Passo 4 - cruzamento de variáveis

df %>% select(height, type_1) %>%
  group_by(type_1) %>% 
  summarise(minimo=min(height),
            primeiro_quartil=quantile(height, probs=0.25),
            mediana=median(height),
            terceiro_quartil=quantile(height, probs=0.75),
            maximo=max(height)) %>%
  flextable() %>% theme_tron()

Passo 5 - visualização dessa tabela

boxplot(height~type_1, data = df,
        col=c("orange", "pink"),
        horizontal = T,
        main="Gráfico Boxplot da altura por tipo 1 de pokemon")

Conclusão

Primeiramente, foi preciso carregar a base de dados “df_pokemon”, em seguida os dados foram analisados para encontrar possíveis erros, contudo não foi necessário tranformá-los, visto que havia variáveis qualitativas e quantitativas na mesma base de dados. Logo, no passo três houve o carregamento das bibliotecas de dados. Já no passo quatro, o cruzei as variáveis “height” e “type_1”. Na tabela é possível verificar o mínimo, primeiro quartil, mediana, terceiro quartil e máximo. O quinto e último passo, é necessário para gerar uma visualização da tabela do passo anterior e também facilita a interpretação e conclusão dos dados. Assim, pode-se afirmar que os tipos de pokemom “flying” e “fighting” possuem os maiores mínimo e menores máximos. Já os tipos de pokemons “water” e “steel” possuem os maiores máximos e o mesmo número no primeiro quartil (número 6).