-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path6_package_json.R
30 lines (29 loc) · 979 Bytes
/
6_package_json.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
library(aws.s3)
library(jsonlite)
tmp <- s3readRDS(paste0("s3://", package_s3_bucket, "/", package_s3_key, "/request.rds"))
tmp$PassengerId <- as.numeric(tmp$PassengerId)
tmp$Pclass <- as.numeric(tmp$Pclass)
tmp$Name <- as.character(tmp$Name)
tmp$Sex <- as.character(tmp$Sex)
tmp$Age <- as.numeric(tmp$Age)
tmp$SibSp <- as.numeric(tmp$SibSp)
tmp$Parch <- as.numeric(tmp$Parch)
tmp$Ticket <- as.character(tmp$Ticket)
tmp$Fare <- as.numeric(tmp$Fare)
tmp$Cabin <- as.character(tmp$Cabin)
tmp$Embarked <- as.character(tmp$Embarked)
tmp$age <- as.character(tmp$age)
tmp$Title <- as.character(tmp$Title)
tmp$A <- as.numeric(tmp$A)
tmp$B <- as.numeric(tmp$B)
tmp$C <- as.numeric(tmp$C)
tmp$D <- as.numeric(tmp$D)
tmp$E <- as.numeric(tmp$E)
tmp$F <- as.numeric(tmp$F)
tmp$ncabin <- as.numeric(tmp$ncabin)
tmp$PC <- as.numeric(tmp$PC)
tmp$STON <- as.numeric(tmp$STON)
tmp$oe <- as.numeric(tmp$oe)
tmp$AGE <- as.numeric(tmp$AGE)
write_json(tmp, "package_test.json", pretty=TRUE)
rm(tmp)