-
Notifications
You must be signed in to change notification settings - Fork 4
/
Pokemon.R
37 lines (21 loc) · 903 Bytes
/
Pokemon.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Pokemon
## In this report, we are going to analyze the different types of Pokemon to check on types and frequencies.
# Checking Frequencies
setwd("./Kaggle")
pokemon <- read.csv('./Pokemon.csv', header = T)
pokemon$Name <- as.character(pokemon$Name)
rev(sort(table(pokemon$Type.1)))
rev(sort(table(pokemon$Type.2)))
library(ggplot2)
library(ggthemes)
library(corrplot)
library(reshape2)
# In this section, we are going to generate a linear model to determine which Pokemon is the strongest in combination.
colnames(pokemon) <- c("number", "name", "type1", "type2", "total", "hp",
"attack", "defense", "sp.atk", "sp.def", "speed",
"generation", "legendary")
head(pokemon)
poke <- lm(total ~ hp + attack + defense + sp.atk + sp.def + speed, pokemon)
par(mfrow = c(2,2))
plot(poke)
pokemon[c(1,3,6), 2]