Libraries
library(RCurl);
Load Data into Data Frame
dfMashroom <- read.csv("https://raw.github.com/simon63/Assignment1/master/mashroom_dataset.csv", header = FALSE, stringsAsFactors = FALSE);
head(dfMashroom);
## V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13 V14 V15 V16 V17 V18 V19 V20
## 1 p x s n t p f c n k e e s s w w p w o p
## 2 e x s y t a f c b k e c s s w w p w o p
## 3 e b s w t l f c b n e c s s w w p w o p
## 4 p x y w t p f c n n e e s s w w p w o p
## 5 e x s g f n f w b k t e s s w w p w o e
## 6 e x y y t a f c b n e c s s w w p w o p
## V21 V22 V23
## 1 k s u
## 2 n n g
## 3 n n m
## 4 k s u
## 5 n a g
## 6 k n g
Create a Subset of Data and Assign Column Names
dfMashroomSub1 <- dfMashroom[,c(1:4, 6)]
colnames(dfMashroomSub1) <- c("edibility", "cap-shape", "cap-surface", "cap-color", "odor")
head(dfMashroomSub1)
## edibility cap-shape cap-surface cap-color odor
## 1 p x s n p
## 2 e x s y a
## 3 e b s w l
## 4 p x y w p
## 5 e x s g n
## 6 e x y y a