#passo 1 - carregar a base de dados
load("C:/Users/helen/Desktop/Base_de_dados-master/df_pokemon.RData")
#passo 2 olha a base de dados
str(df)
## Classes 'tbl_df', 'tbl' and 'data.frame': 718 obs. of 22 variables:
## $ id : num 1 2 3 4 5 6 7 8 9 10 ...
## $ pokemon : chr "bulbasaur" "ivysaur" "venusaur" "charmander" ...
## $ species_id : int 1 2 3 4 5 6 7 8 9 10 ...
## $ height : int 7 10 20 6 11 17 5 10 16 3 ...
## $ weight : int 69 130 1000 85 190 905 90 225 855 29 ...
## $ base_experience: int 64 142 236 62 142 240 63 142 239 39 ...
## $ type_1 : chr "grass" "grass" "grass" "fire" ...
## $ type_2 : chr "poison" "poison" "poison" NA ...
## $ attack : int 49 62 82 52 64 84 48 63 83 30 ...
## $ defense : int 49 63 83 43 58 78 65 80 100 35 ...
## $ hp : int 45 60 80 39 58 78 44 59 79 45 ...
## $ special_attack : int 65 80 100 60 80 109 50 65 85 20 ...
## $ special_defense: int 65 80 100 50 65 85 64 80 105 20 ...
## $ speed : int 45 60 80 65 80 100 43 58 78 45 ...
## $ color_1 : chr "#78C850" "#78C850" "#78C850" "#F08030" ...
## $ color_2 : chr "#A040A0" "#A040A0" "#A040A0" NA ...
## $ color_f : chr "#81A763" "#81A763" "#81A763" "#F08030" ...
## $ egg_group_1 : chr "monster" "monster" "monster" "monster" ...
## $ egg_group_2 : chr "plant" "plant" "plant" "dragon" ...
## $ url_image : chr "1.png" "2.png" "3.png" "4.png" ...
## $ x : num 32.8 33.3 33.9 -24.4 -24.6 ...
## $ y : num 17.2 16.7 16.2 30.8 30.6 ...
tabela<- table (df$type_1)
tabela
##
## bug dark dragon electric fairy fighting fire flying
## 63 28 24 36 17 25 46 3
## ghost grass ground ice normal poison psychic rock
## 23 66 30 23 93 28 46 40
## steel water
## 22 105
prop.table(tabela)
##
## bug dark dragon electric fairy fighting
## 0.087743733 0.038997214 0.033426184 0.050139276 0.023676880 0.034818942
## fire flying ghost grass ground ice
## 0.064066852 0.004178273 0.032033426 0.091922006 0.041782730 0.032033426
## normal poison psychic rock steel water
## 0.129526462 0.038997214 0.064066852 0.055710306 0.030640669 0.146239554
pie(tabela)
barplot(tabela)
barplot(tabela, col=c("#bdf0e7", "#535958", "#000000", "#ffb5e1", "#d465e6", "#ffff9e", "#ffffff", "brown", "#b1f2c4", "#dde3bc", "#6879ba", "#e63030", "#fca030", "#fadced", "#203045", "#660404", "#0e260f", "#fff947"),main = " Tipos 1",horiz=T,legend.text = rownames(tabela),args.legend = list(x= "topleft"))
tabela1<- table (df$type_2)
tabela1
##
## bug dark dragon electric fairy fighting fire flying
## 3 16 14 6 17 19 9 87
## ghost grass ground ice normal poison psychic rock
## 11 18 30 10 4 31 27 14
## steel water
## 19 12
prop.table(tabela1)
##
## bug dark dragon electric fairy fighting
## 0.008645533 0.046109510 0.040345821 0.017291066 0.048991354 0.054755043
## fire flying ghost grass ground ice
## 0.025936599 0.250720461 0.031700288 0.051873199 0.086455331 0.028818444
## normal poison psychic rock steel water
## 0.011527378 0.089337176 0.077809798 0.040345821 0.054755043 0.034582133
pie(tabela1)
barplot(tabela1)
barplot(tabela1, col=c("#bdf0e7", "#535958", "#000000", "#ffb5e1", "#d465e6", "#ffff9e", "#ffffff", "brown", "#b1f2c4", "#dde3bc", "#6879ba", "#e63030", "#fca030", "#fadced", "#203045", "#660404", "#0e260f", "#fff947"),main = " Tipos 2",horiz=T,legend.text = rownames(tabela1),args.legend = list(x= "topleft"))
tabela2<- table (df$color_1)
tabela2
##
## #6890F0 #7038F8 #705848 #705898 #78C850 #98D8D8 #A040A0 #A890F0 #A8A878 #A8B820
## 105 24 28 23 66 23 28 3 93 63
## #B8A038 #B8B8D0 #C03028 #E0C068 #EE99AC #F08030 #F85888 #F8D030
## 40 22 25 30 17 46 46 36
prop.table(tabela2)
##
## #6890F0 #7038F8 #705848 #705898 #78C850 #98D8D8
## 0.146239554 0.033426184 0.038997214 0.032033426 0.091922006 0.032033426
## #A040A0 #A890F0 #A8A878 #A8B820 #B8A038 #B8B8D0
## 0.038997214 0.004178273 0.129526462 0.087743733 0.055710306 0.030640669
## #C03028 #E0C068 #EE99AC #F08030 #F85888 #F8D030
## 0.034818942 0.041782730 0.023676880 0.064066852 0.064066852 0.050139276
pie(tabela2)
barplot(tabela2)
barplot(tabela2, col=c("#6890F0", "#7038F8", "#705848", "#705898", "#78C850", "#98D8D8", "#A040A0", "#A890F0", "#A8A878", "#A8B820", "#B8A038", "#B8B8D0", "#C03028", "#E0C068", "#EE99AC", "#F08030", "#F85888", "#F8D030"),main = " Cores 1",legend.text = rownames(tabela2))
tabela3<- table (df$color_2)
tabela3
##
## #6890F0 #7038F8 #705848 #705898 #78C850 #98D8D8 #A040A0 #A890F0 #A8A878 #A8B820
## 12 14 16 11 18 10 31 87 4 3
## #B8A038 #B8B8D0 #C03028 #E0C068 #EE99AC #F08030 #F85888 #F8D030
## 14 19 19 30 17 9 27 6
prop.table(tabela3)
##
## #6890F0 #7038F8 #705848 #705898 #78C850 #98D8D8
## 0.034582133 0.040345821 0.046109510 0.031700288 0.051873199 0.028818444
## #A040A0 #A890F0 #A8A878 #A8B820 #B8A038 #B8B8D0
## 0.089337176 0.250720461 0.011527378 0.008645533 0.040345821 0.054755043
## #C03028 #E0C068 #EE99AC #F08030 #F85888 #F8D030
## 0.054755043 0.086455331 0.048991354 0.025936599 0.077809798 0.017291066
pie(tabela3)
barplot(tabela3)
barplot(tabela3, col=c("#6890F0", "#7038F8", "#705848", "#705898", "#78C850", "#98D8D8", "#A040A0", "#A890F0", "#A8A878", "#A8B820", "#B8A038", "#B8B8D0", "#C03028", "#E0C068", "#EE99AC", "#F08030", "#F85888", "#F8D030"),main = " Cores 2",legend.text = rownames(tabela3))
tabela4<- table (df$egg_group_1)
tabela4
##
## bug ditto dragon fairy flying
## 66 1 9 32 46
## ground humanshape indeterminate mineral monster
## 167 37 41 46 75
## no-eggs plant water1 water2 water3
## 70 25 74 15 14
prop.table(tabela4)
##
## bug ditto dragon fairy flying
## 0.091922006 0.001392758 0.012534819 0.044568245 0.064066852
## ground humanshape indeterminate mineral monster
## 0.232590529 0.051532033 0.057103064 0.064066852 0.104456825
## no-eggs plant water1 water2 water3
## 0.097493036 0.034818942 0.103064067 0.020891365 0.019498607
pie(tabela4)
barplot(tabela4)
barplot(tabela4, col=c("white", "#fc9a9a", "#fcd09a", "#fcf49a", "#ddfc9a","#9dfc9a", "#9afcd8", "#9afcf8", "#9ac0fc", "#ae9afc", "#d79afc", "#fc9afc", "#fc9ad5", "gray", "black"),main = " Classificação do ovo pokemon",legend.text = rownames(tabela4))
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
summary(df$weight)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 1.0 95.0 280.0 568.2 609.5 9500.0
#HISTOGRAMA
hist(df$weight)
hist(df$weight,col= "#d79afc", main= "Histograma do peso dos pokemons", xlab = "Peso dos pokemons", ylab= "Frenquencia")
#CONCLUSÃO
O histograma mostra que a maioria dos pokemons pesa entre 0 e 2000 gramas. Se trata de um grafico assimetrico a direita.