-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.Rhistory
61 lines (61 loc) · 2.87 KB
/
.Rhistory
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
install.packages("rmarkdown")
refine <- refine %<>%
mutate(company = replace(company, company %in% c("philips", "phllips", "phillps", "fillips", "phlips"), "phillips")) %>%
mutate(company = replace(company, company %in% c("ak zo", "akz0"), "akzo"))%>%
mutate(company = replace(company, company %in% c("ak zo", "akz0"), "akzo"))%>%
mutate(company = replace(company, company %in% c("unilver"), "unilever"))
library("dplyr", lib.loc="~/R/win-library/3.4")
library("magrittr", lib.loc="~/R/win-library/3.4")
library("stringr", lib.loc="~/R/win-library/3.4")
library("tidyr", lib.loc="~/R/win-library/3.4")
refine <- refine %>%
mutate("product_code" = substr(Product.code...number,1,1))%>%
mutate("product_number" = substr(Product.code...number,3,5))
titanic3$boat[is.na(titanic3$boat)] <- "None"
library(devtools)
library(dplyr)
library(tidyr)
titanic3<- read.csv("titanic3.csv", header=TRUE)
View(titanic3)
titanic3$embarked[titanic3$embarked==""] <- "S"
titanic3$age[is.na(titanic3$age)] <- mean(titanic3$age, na.rm = TRUE)
titanic3$boat[is.na(titanic3$boat)] <- "None"
setwd("C:/Users/bryfe/Desktop/springboard/titanic")
library(devtools)
library(dplyr)
library(tidyr)
titanic3<- read.csv("titanic3.csv", header=TRUE)
View(titanic3)
titanic3$embarked[titanic3$embarked==""] <- "S"
titanic3$age[is.na(titanic3$age)] <- mean(titanic3$age, na.rm = TRUE)
titanic3$boat[is.na(titanic3$boat)] <- "None"
titanic3$boat[is.na(titanic3$boat)] <- as.character("None")
library(devtools)
titanic3$embarked[titanic3$embarked==""] <- as.character("None")
titanic3$boat[titanic3$boat==""] <- as.character("None")
titanic3$boat[is.na(titanic3$boat)] <- as.character("None")
library(devtools)
library(dplyr)
library(tidyr)
titanic3<- read.csv("titanic3.csv", header=TRUE, stringsAsFactors = FALSE)
View(titanic3)
titanic3$embarked[titanic3$embarked==""] <- "S"
titanic3$age[is.na(titanic3$age)] <- mean(titanic3$age, na.rm = TRUE)
titanic3$boat[is.na(titanic3$boat)] <- as.character("None")
titanic3$boat[is.na(titanic3$boat)] <- as.character("None")
titanic3$boat[is.na(titanic3$boat)] <- as.character("None")
titanic3$boat[titanic3$boat==""] <- "NONE"
titanic3 %>% mutate("has_cabin_number", ifelse(titanic3$cabin =="",0,1))
titanic3 <- titanic3 %>% mutate("has_cabin_number", ifelse(titanic3$cabin =="",0,1))
titanic3 <- titanic3 %>% mutate(titanic3,has_cabin_number, ifelse(titanic3$cabin =="",0,1))
titanic3 <- titanic3 %>% mutate(has_cabin_number, ifelse(titanic3$cabin =="",0,1))
titanic3 <- titanic3 %>% mutate(has_cabin_number = ifelse(titanic3$cabin =="",0,1))
library(devtools)
library(dplyr)
library(tidyr)
titanic3<- read.csv("titanic_original.csv", header=TRUE, stringsAsFactors = FALSE)
View(titanic3)
titanic3$embarked[titanic3$embarked==""] <- "S"
titanic3$age[is.na(titanic3$age)] <- mean(titanic3$age, na.rm = TRUE)
titanic3$boat[titanic3$boat==""] <- "NONE"
titanic3 <- titanic3 %>% mutate(has_cabin_number = ifelse(titanic3$cabin =="",0,1))