load("C:/Users/Ana Beatriz/Downloads/Base_de_dados-master/df_pokemon.RData")
df$type_1<-as.factor(df$type_1)
df$type_2<-as.factor(df$type_2)
TabelaComparativaPokemon<-table(df$type_1,df$type_2)
prop.table(TabelaComparativaPokemon)
##
## bug dark dragon electric fairy
## bug 0.000000000 0.000000000 0.000000000 0.005763689 0.000000000
## dark 0.000000000 0.000000000 0.008645533 0.000000000 0.000000000
## dragon 0.000000000 0.000000000 0.000000000 0.002881844 0.000000000
## electric 0.000000000 0.000000000 0.000000000 0.000000000 0.002881844
## fairy 0.000000000 0.000000000 0.000000000 0.000000000 0.000000000
## fighting 0.000000000 0.002881844 0.000000000 0.000000000 0.000000000
## fire 0.000000000 0.000000000 0.000000000 0.000000000 0.000000000
## flying 0.000000000 0.000000000 0.005763689 0.000000000 0.000000000
## ghost 0.000000000 0.002881844 0.002881844 0.000000000 0.000000000
## grass 0.000000000 0.008645533 0.000000000 0.000000000 0.005763689
## ground 0.000000000 0.008645533 0.005763689 0.002881844 0.000000000
## ice 0.000000000 0.000000000 0.000000000 0.000000000 0.000000000
## normal 0.000000000 0.000000000 0.000000000 0.000000000 0.011527378
## poison 0.002881844 0.008645533 0.002881844 0.000000000 0.000000000
## psychic 0.000000000 0.000000000 0.000000000 0.000000000 0.014409222
## rock 0.005763689 0.002881844 0.005763689 0.000000000 0.002881844
## steel 0.000000000 0.000000000 0.002881844 0.000000000 0.005763689
## water 0.000000000 0.011527378 0.005763689 0.005763689 0.005763689
##
## fighting fire flying ghost grass
## bug 0.002881844 0.005763689 0.037463977 0.002881844 0.017291066
## dark 0.005763689 0.005763689 0.014409222 0.002881844 0.000000000
## dragon 0.000000000 0.002881844 0.011527378 0.000000000 0.000000000
## electric 0.000000000 0.000000000 0.008645533 0.002881844 0.000000000
## fairy 0.000000000 0.000000000 0.005763689 0.000000000 0.000000000
## fighting 0.000000000 0.000000000 0.002881844 0.000000000 0.000000000
## fire 0.017291066 0.000000000 0.014409222 0.000000000 0.000000000
## flying 0.000000000 0.000000000 0.000000000 0.000000000 0.000000000
## ghost 0.000000000 0.008645533 0.005763689 0.000000000 0.011527378
## grass 0.008645533 0.000000000 0.011527378 0.000000000 0.000000000
## ground 0.000000000 0.000000000 0.008645533 0.005763689 0.000000000
## ice 0.000000000 0.000000000 0.005763689 0.002881844 0.000000000
## normal 0.000000000 0.000000000 0.066282421 0.000000000 0.005763689
## poison 0.005763689 0.000000000 0.008645533 0.000000000 0.000000000
## psychic 0.002881844 0.002881844 0.017291066 0.000000000 0.002881844
## rock 0.002881844 0.000000000 0.008645533 0.000000000 0.005763689
## steel 0.002881844 0.000000000 0.002881844 0.008645533 0.000000000
## water 0.005763689 0.000000000 0.020172911 0.005763689 0.008645533
##
## ground ice normal poison psychic
## bug 0.002881844 0.000000000 0.000000000 0.031700288 0.000000000
## dark 0.000000000 0.005763689 0.000000000 0.000000000 0.005763689
## dragon 0.011527378 0.002881844 0.000000000 0.000000000 0.005763689
## electric 0.000000000 0.000000000 0.005763689 0.000000000 0.000000000
## fairy 0.000000000 0.000000000 0.000000000 0.000000000 0.000000000
## fighting 0.000000000 0.000000000 0.000000000 0.000000000 0.005763689
## fire 0.005763689 0.000000000 0.005763689 0.000000000 0.002881844
## flying 0.000000000 0.000000000 0.000000000 0.000000000 0.000000000
## ghost 0.000000000 0.000000000 0.000000000 0.008645533 0.000000000
## grass 0.002881844 0.005763689 0.000000000 0.040345821 0.005763689
## ground 0.000000000 0.000000000 0.000000000 0.000000000 0.005763689
## ice 0.008645533 0.000000000 0.000000000 0.000000000 0.005763689
## normal 0.002881844 0.000000000 0.000000000 0.000000000 0.005763689
## poison 0.005763689 0.000000000 0.000000000 0.000000000 0.000000000
## psychic 0.000000000 0.000000000 0.000000000 0.000000000 0.000000000
## rock 0.017291066 0.005763689 0.000000000 0.000000000 0.005763689
## steel 0.002881844 0.000000000 0.000000000 0.000000000 0.017291066
## water 0.025936599 0.008645533 0.000000000 0.008645533 0.011527378
##
## rock steel water
## bug 0.008645533 0.014409222 0.002881844
## dark 0.000000000 0.005763689 0.000000000
## dragon 0.000000000 0.000000000 0.000000000
## electric 0.000000000 0.008645533 0.000000000
## fairy 0.000000000 0.000000000 0.000000000
## fighting 0.000000000 0.002881844 0.000000000
## fire 0.002881844 0.002881844 0.000000000
## flying 0.000000000 0.000000000 0.000000000
## ghost 0.000000000 0.000000000 0.000000000
## grass 0.000000000 0.005763689 0.000000000
## ground 0.008645533 0.002881844 0.000000000
## ice 0.000000000 0.000000000 0.008645533
## normal 0.000000000 0.000000000 0.002881844
## poison 0.000000000 0.000000000 0.002881844
## psychic 0.000000000 0.000000000 0.000000000
## rock 0.000000000 0.008645533 0.017291066
## steel 0.008645533 0.000000000 0.000000000
## water 0.011527378 0.002881844 0.000000000
prop.table(TabelaComparativaPokemon,1)*100
##
## bug dark dragon electric fairy
## bug 0.000000 0.000000 0.000000 4.347826 0.000000
## dark 0.000000 0.000000 15.789474 0.000000 0.000000
## dragon 0.000000 0.000000 0.000000 7.692308 0.000000
## electric 0.000000 0.000000 0.000000 0.000000 10.000000
## fairy 0.000000 0.000000 0.000000 0.000000 0.000000
## fighting 0.000000 20.000000 0.000000 0.000000 0.000000
## fire 0.000000 0.000000 0.000000 0.000000 0.000000
## flying 0.000000 0.000000 100.000000 0.000000 0.000000
## ghost 0.000000 7.142857 7.142857 0.000000 0.000000
## grass 0.000000 9.090909 0.000000 0.000000 6.060606
## ground 0.000000 17.647059 11.764706 5.882353 0.000000
## ice 0.000000 0.000000 0.000000 0.000000 0.000000
## normal 0.000000 0.000000 0.000000 0.000000 12.121212
## poison 7.692308 23.076923 7.692308 0.000000 0.000000
## psychic 0.000000 0.000000 0.000000 0.000000 35.714286
## rock 6.451613 3.225806 6.451613 0.000000 3.225806
## steel 0.000000 0.000000 5.555556 0.000000 11.111111
## water 0.000000 8.333333 4.166667 4.166667 4.166667
##
## fighting fire flying ghost grass
## bug 2.173913 4.347826 28.260870 2.173913 13.043478
## dark 10.526316 10.526316 26.315789 5.263158 0.000000
## dragon 0.000000 7.692308 30.769231 0.000000 0.000000
## electric 0.000000 0.000000 30.000000 10.000000 0.000000
## fairy 0.000000 0.000000 100.000000 0.000000 0.000000
## fighting 0.000000 0.000000 20.000000 0.000000 0.000000
## fire 33.333333 0.000000 27.777778 0.000000 0.000000
## flying 0.000000 0.000000 0.000000 0.000000 0.000000
## ghost 0.000000 21.428571 14.285714 0.000000 28.571429
## grass 9.090909 0.000000 12.121212 0.000000 0.000000
## ground 0.000000 0.000000 17.647059 11.764706 0.000000
## ice 0.000000 0.000000 18.181818 9.090909 0.000000
## normal 0.000000 0.000000 69.696970 0.000000 6.060606
## poison 15.384615 0.000000 23.076923 0.000000 0.000000
## psychic 7.142857 7.142857 42.857143 0.000000 7.142857
## rock 3.225806 0.000000 9.677419 0.000000 6.451613
## steel 5.555556 0.000000 5.555556 16.666667 0.000000
## water 4.166667 0.000000 14.583333 4.166667 6.250000
##
## ground ice normal poison psychic
## bug 2.173913 0.000000 0.000000 23.913043 0.000000
## dark 0.000000 10.526316 0.000000 0.000000 10.526316
## dragon 30.769231 7.692308 0.000000 0.000000 15.384615
## electric 0.000000 0.000000 20.000000 0.000000 0.000000
## fairy 0.000000 0.000000 0.000000 0.000000 0.000000
## fighting 0.000000 0.000000 0.000000 0.000000 40.000000
## fire 11.111111 0.000000 11.111111 0.000000 5.555556
## flying 0.000000 0.000000 0.000000 0.000000 0.000000
## ghost 0.000000 0.000000 0.000000 21.428571 0.000000
## grass 3.030303 6.060606 0.000000 42.424242 6.060606
## ground 0.000000 0.000000 0.000000 0.000000 11.764706
## ice 27.272727 0.000000 0.000000 0.000000 18.181818
## normal 3.030303 0.000000 0.000000 0.000000 6.060606
## poison 15.384615 0.000000 0.000000 0.000000 0.000000
## psychic 0.000000 0.000000 0.000000 0.000000 0.000000
## rock 19.354839 6.451613 0.000000 0.000000 6.451613
## steel 5.555556 0.000000 0.000000 0.000000 33.333333
## water 18.750000 6.250000 0.000000 6.250000 8.333333
##
## rock steel water
## bug 6.521739 10.869565 2.173913
## dark 0.000000 10.526316 0.000000
## dragon 0.000000 0.000000 0.000000
## electric 0.000000 30.000000 0.000000
## fairy 0.000000 0.000000 0.000000
## fighting 0.000000 20.000000 0.000000
## fire 5.555556 5.555556 0.000000
## flying 0.000000 0.000000 0.000000
## ghost 0.000000 0.000000 0.000000
## grass 0.000000 6.060606 0.000000
## ground 17.647059 5.882353 0.000000
## ice 0.000000 0.000000 27.272727
## normal 0.000000 0.000000 3.030303
## poison 0.000000 0.000000 7.692308
## psychic 0.000000 0.000000 0.000000
## rock 0.000000 9.677419 19.354839
## steel 16.666667 0.000000 0.000000
## water 8.333333 2.083333 0.000000