-
Notifications
You must be signed in to change notification settings - Fork 0
/
yelp.R
35 lines (22 loc) · 1.2 KB
/
yelp.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
library(plyr)
library(RJSONIO)
con <- file('C:/Users/HEARU/Documents/yelp_dataset/yelp_academic_dataset_business.json', "r")
df <- ldply(fromJSON(con), data.frame)
close(con)
write.csv(df,"C:/Users/HEARU/Documents/yelp_dataset/yelp_academic_dataset_business.csv")
con <- file('C:/Users/HEARU/Documents/yelp_dataset/yelp_academic_dataset_checkin.json', "r")
df <- ldply(fromJSON(con), data.frame)
close(con)
write.csv(df,"C:/Users/HEARU/Documents/yelp_dataset/yelp_academic_dataset_checkin.json.csv")
con <- file('C:/Users/HEARU/Documents/yelp_dataset/yelp_academic_dataset_tip.json', "r")
df <- ldply(fromJSON(con), data.frame)
close(con)
write.csv(df,"C:/Users/HEARU/Documents/yelp_dataset/yelp_academic_dataset_tip.csv")
con <- file('C:/Users/HEARU/Documents/yelp_dataset/yelp_academic_dataset_user.json', "r")
df <- ldply(fromJSON(con), data.frame)
close(con)
write.csv(df,"C:/Users/HEARU/Documents/yelp_dataset/yelp_academic_dataset_user.csv")
con <- file('C:/Users/HEARU/Documents/yelp_dataset/yelp_academic_dataset_user.json', "r")
df <- ldply(fromJSON(con), data.frame)
close(con)
write.csv(df,"C:/Users/HEARU/Documents/yelp_dataset/yelp_academic_dataset_user.csv")