-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathread-data.R
22 lines (19 loc) · 1.21 KB
/
read-data.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#This script is used to read data using `read.csv` command
setwd("/TalkingData/") # set working directory
options(stringsAsFactors = FALSE) #set global option to read files
library(dplyr) #load `dplyr` package
app_events <- read.csv("app_events.csv/app_events.csv", colClasses = c("integer", "character", "integer", "integer"))
app_labels <- read.csv("app_labels.csv/app_labels.csv", colClasses = c("character", "integer"))
events <- read.csv("events.csv/events.csv", colClasses = c("integer", "character", "character", "numeric", "numeric"))
gender_age_train <- read.csv("gender_age_train.csv/gender_age_train.csv",
colClasses = c("character", "character", "integer", "character"))
label_categories <- read.csv("label_categories.csv/label_categories.csv", colClasses = c("integer", "character"))
phone_brand_device_model <- read.csv("phone_brand_device_model.csv/phone_brand_device_model.csv",
colClasses = c("character","character","character"))
#convert "data.frame" into "tibble"
app_events <- tbl_df(app_events)
app_labels <- tbl_df(app_labels)
events <- tbl_df(events)
gender_age_train <- tbl_df(gender_age_train)
label_categories <- tbl_df(label_categories)
phone_brand_device_model <- tbl_df(phone_brand_device_model)