Data Test Report

Created by

Rischan Mafrur

Chonnam National University of South Korea

June 15, 2014

Checking Duplicated Data

Loading Library and set working directory

library("RSQLite")

driver <- dbDriver("SQLite")
setwd("F:/behavio/db/data-15-3-pm")

Adding Sqlite database to R, test 8 databases

con2 <- dbConnect(driver,"x (2).db")
con3 <- dbConnect(driver,"x (3).db")
con4 <- dbConnect(driver,"x (4).db")
con5 <- dbConnect(driver,"x (5).db")

con20 <- dbConnect(driver,"x (20).db")
con30 <- dbConnect(driver,"x (30).db")
con40 <- dbConnect(driver,"x (40).db")
con50 <- dbConnect(driver,"x (50).db")

See the list of tables and columns, example use db2

dbListTables(con2)
## [1] "android_metadata" "data"             "file_info"       
## [4] "sqlite_sequence"
dbListFields(con2,"data")
## [1] "_id"       "name"      "timestamp" "value"

Select data (select * from data)

df2 <- dbGetQuery(con2,"Select * from data")
df3 <- dbGetQuery(con3,"Select * from data")
df4 <- dbGetQuery(con4,"Select * from data")
df5 <- dbGetQuery(con5,"Select * from data")

df20 <- dbGetQuery(con20,"Select * from data")
df30 <- dbGetQuery(con30,"Select * from data")
df40 <- dbGetQuery(con40,"Select * from data")
df50 <- dbGetQuery(con50,"Select * from data")

Check number of rows of tables "data" for each databases

nrow(df2) 
## [1] 8583
nrow(df3) 
## [1] 6670
nrow(df4) 
## [1] 7862
nrow(df5)
## [1] 7629
nrow(df20) 
## [1] 8474
nrow(df30) 
## [1] 8177
nrow(df40) 
## [1] 4255
nrow(df50)
## [1] 6009

Show data distribution, how many rows for each probes name:

table(df2$name)
## 
##            edu.mit.media.funf.probe.builtin.ActivityProbe 
##                                                        26 
##        edu.mit.media.funf.probe.builtin.ApplicationsProbe 
##                                                      1077 
##             edu.mit.media.funf.probe.builtin.BatteryProbe 
##                                                         2 
##             edu.mit.media.funf.probe.builtin.CallLogProbe 
##                                                      1452 
##             edu.mit.media.funf.probe.builtin.ContactProbe 
##                                                      1658 
##        edu.mit.media.funf.probe.builtin.HardwareInfoProbe 
##                                                         2 
##         edu.mit.media.funf.probe.builtin.LightSensorProbe 
##                                                      1478 
## edu.mit.media.funf.probe.builtin.MagneticFieldSensorProbe 
##                                                      1028 
##      edu.mit.media.funf.probe.builtin.PressureSensorProbe 
##                                                        92 
##     edu.mit.media.funf.probe.builtin.ProximitySensorProbe 
##                                                         3 
## edu.mit.media.funf.probe.builtin.RunningApplicationsProbe 
##                                                        44 
##              edu.mit.media.funf.probe.builtin.ScreenProbe 
##                                                         7 
##      edu.mit.media.funf.probe.builtin.SimpleLocationProbe 
##                                                         3 
##                 edu.mit.media.funf.probe.builtin.SmsProbe 
##                                                      1666 
##                edu.mit.media.funf.probe.builtin.WifiProbe 
##                                                        45
table(df3$name)
## 
##            edu.mit.media.funf.probe.builtin.ActivityProbe 
##                                                        25 
##        edu.mit.media.funf.probe.builtin.ApplicationsProbe 
##                                                       718 
##             edu.mit.media.funf.probe.builtin.BatteryProbe 
##                                                         2 
##             edu.mit.media.funf.probe.builtin.CallLogProbe 
##                                                       969 
##             edu.mit.media.funf.probe.builtin.ContactProbe 
##                                                      1658 
##        edu.mit.media.funf.probe.builtin.HardwareInfoProbe 
##                                                         2 
##         edu.mit.media.funf.probe.builtin.LightSensorProbe 
##                                                      1086 
## edu.mit.media.funf.probe.builtin.MagneticFieldSensorProbe 
##                                                       816 
##      edu.mit.media.funf.probe.builtin.PressureSensorProbe 
##                                                       188 
##     edu.mit.media.funf.probe.builtin.ProximitySensorProbe 
##                                                         2 
## edu.mit.media.funf.probe.builtin.RunningApplicationsProbe 
##                                                         2 
##              edu.mit.media.funf.probe.builtin.ScreenProbe 
##                                                         2 
##      edu.mit.media.funf.probe.builtin.SimpleLocationProbe 
##                                                         2 
##                 edu.mit.media.funf.probe.builtin.SmsProbe 
##                                                      1156 
##                edu.mit.media.funf.probe.builtin.WifiProbe 
##                                                        42
table(df4$name)
## 
##            edu.mit.media.funf.probe.builtin.ActivityProbe 
##                                                        21 
##        edu.mit.media.funf.probe.builtin.ApplicationsProbe 
##                                                       718 
##             edu.mit.media.funf.probe.builtin.BatteryProbe 
##                                                         2 
##             edu.mit.media.funf.probe.builtin.CallLogProbe 
##                                                       970 
##             edu.mit.media.funf.probe.builtin.ContactProbe 
##                                                      1658 
##        edu.mit.media.funf.probe.builtin.HardwareInfoProbe 
##                                                         2 
##         edu.mit.media.funf.probe.builtin.LightSensorProbe 
##                                                      1613 
## edu.mit.media.funf.probe.builtin.MagneticFieldSensorProbe 
##                                                      1404 
##      edu.mit.media.funf.probe.builtin.PressureSensorProbe 
##                                                       159 
##     edu.mit.media.funf.probe.builtin.ProximitySensorProbe 
##                                                         2 
## edu.mit.media.funf.probe.builtin.RunningApplicationsProbe 
##                                                        12 
##              edu.mit.media.funf.probe.builtin.ScreenProbe 
##                                                         6 
##      edu.mit.media.funf.probe.builtin.SimpleLocationProbe 
##                                                         2 
##                 edu.mit.media.funf.probe.builtin.SmsProbe 
##                                                      1249 
##                edu.mit.media.funf.probe.builtin.WifiProbe 
##                                                        44
table(df5$name)
## 
##            edu.mit.media.funf.probe.builtin.ActivityProbe 
##                                                        23 
##        edu.mit.media.funf.probe.builtin.ApplicationsProbe 
##                                                       718 
##             edu.mit.media.funf.probe.builtin.BatteryProbe 
##                                                         2 
##             edu.mit.media.funf.probe.builtin.CallLogProbe 
##                                                       970 
##             edu.mit.media.funf.probe.builtin.ContactProbe 
##                                                      1658 
##        edu.mit.media.funf.probe.builtin.HardwareInfoProbe 
##                                                         2 
##         edu.mit.media.funf.probe.builtin.LightSensorProbe 
##                                                      1553 
## edu.mit.media.funf.probe.builtin.MagneticFieldSensorProbe 
##                                                      1297 
##      edu.mit.media.funf.probe.builtin.PressureSensorProbe 
##                                                       135 
##     edu.mit.media.funf.probe.builtin.ProximitySensorProbe 
##                                                         2 
## edu.mit.media.funf.probe.builtin.RunningApplicationsProbe 
##                                                        11 
##              edu.mit.media.funf.probe.builtin.ScreenProbe 
##                                                        10 
##      edu.mit.media.funf.probe.builtin.SimpleLocationProbe 
##                                                         1 
##                 edu.mit.media.funf.probe.builtin.SmsProbe 
##                                                      1197 
##                edu.mit.media.funf.probe.builtin.WifiProbe 
##                                                        50
table(df20$name)
## 
##            edu.mit.media.funf.probe.builtin.ActivityProbe 
##                                                        23 
##        edu.mit.media.funf.probe.builtin.ApplicationsProbe 
##                                                       718 
##             edu.mit.media.funf.probe.builtin.BatteryProbe 
##                                                         2 
##             edu.mit.media.funf.probe.builtin.CallLogProbe 
##                                                       970 
##             edu.mit.media.funf.probe.builtin.ContactProbe 
##                                                      1658 
##        edu.mit.media.funf.probe.builtin.HardwareInfoProbe 
##                                                         2 
##         edu.mit.media.funf.probe.builtin.LightSensorProbe 
##                                                      1651 
## edu.mit.media.funf.probe.builtin.MagneticFieldSensorProbe 
##                                                      1273 
##      edu.mit.media.funf.probe.builtin.PressureSensorProbe 
##                                                       309 
##     edu.mit.media.funf.probe.builtin.ProximitySensorProbe 
##                                                         3 
##      edu.mit.media.funf.probe.builtin.SimpleLocationProbe 
##                                                         2 
##                 edu.mit.media.funf.probe.builtin.SmsProbe 
##                                                      1808 
##                edu.mit.media.funf.probe.builtin.WifiProbe 
##                                                        55
table(df30$name)
## 
##            edu.mit.media.funf.probe.builtin.ActivityProbe 
##                                                        10 
##        edu.mit.media.funf.probe.builtin.ApplicationsProbe 
##                                                      1077 
##             edu.mit.media.funf.probe.builtin.BatteryProbe 
##                                                         2 
##             edu.mit.media.funf.probe.builtin.CallLogProbe 
##                                                      1455 
##             edu.mit.media.funf.probe.builtin.ContactProbe 
##                                                      1658 
##        edu.mit.media.funf.probe.builtin.HardwareInfoProbe 
##                                                         3 
##         edu.mit.media.funf.probe.builtin.LightSensorProbe 
##                                                      1269 
## edu.mit.media.funf.probe.builtin.MagneticFieldSensorProbe 
##                                                       911 
##      edu.mit.media.funf.probe.builtin.PressureSensorProbe 
##                                                       180 
##     edu.mit.media.funf.probe.builtin.ProximitySensorProbe 
##                                                         3 
## edu.mit.media.funf.probe.builtin.RunningApplicationsProbe 
##                                                         1 
##              edu.mit.media.funf.probe.builtin.ScreenProbe 
##                                                         2 
##      edu.mit.media.funf.probe.builtin.SimpleLocationProbe 
##                                                         3 
##                 edu.mit.media.funf.probe.builtin.SmsProbe 
##                                                      1521 
##                edu.mit.media.funf.probe.builtin.WifiProbe 
##                                                        82
table(df40$name)
## 
##            edu.mit.media.funf.probe.builtin.ActivityProbe 
##                                                         2 
##        edu.mit.media.funf.probe.builtin.ApplicationsProbe 
##                                                       483 
##             edu.mit.media.funf.probe.builtin.BatteryProbe 
##                                                         2 
##             edu.mit.media.funf.probe.builtin.CallLogProbe 
##                                                       578 
##             edu.mit.media.funf.probe.builtin.ContactProbe 
##                                                      1658 
##        edu.mit.media.funf.probe.builtin.HardwareInfoProbe 
##                                                         2 
##         edu.mit.media.funf.probe.builtin.LightSensorProbe 
##                                                       274 
## edu.mit.media.funf.probe.builtin.MagneticFieldSensorProbe 
##                                                       254 
##      edu.mit.media.funf.probe.builtin.PressureSensorProbe 
##                                                        64 
##     edu.mit.media.funf.probe.builtin.ProximitySensorProbe 
##                                                         2 
##      edu.mit.media.funf.probe.builtin.SimpleLocationProbe 
##                                                         1 
##                 edu.mit.media.funf.probe.builtin.SmsProbe 
##                                                       935
table(df50$name)
## 
##            edu.mit.media.funf.probe.builtin.ActivityProbe 
##                                                         6 
##        edu.mit.media.funf.probe.builtin.ApplicationsProbe 
##                                                       535 
##             edu.mit.media.funf.probe.builtin.BatteryProbe 
##                                                         2 
##             edu.mit.media.funf.probe.builtin.CallLogProbe 
##                                                      1103 
##             edu.mit.media.funf.probe.builtin.ContactProbe 
##                                                      1658 
##        edu.mit.media.funf.probe.builtin.HardwareInfoProbe 
##                                                         2 
##         edu.mit.media.funf.probe.builtin.LightSensorProbe 
##                                                       839 
## edu.mit.media.funf.probe.builtin.MagneticFieldSensorProbe 
##                                                       638 
##      edu.mit.media.funf.probe.builtin.PressureSensorProbe 
##                                                        96 
##     edu.mit.media.funf.probe.builtin.ProximitySensorProbe 
##                                                         2 
##      edu.mit.media.funf.probe.builtin.SimpleLocationProbe 
##                                                         2 
##                 edu.mit.media.funf.probe.builtin.SmsProbe 
##                                                      1108 
##                edu.mit.media.funf.probe.builtin.WifiProbe 
##                                                        18

Show the duplicated rows in table for each databases: true values means the numbers of duplicated rows.

summary(duplicated(df2[,c(2,4)]))
##    Mode   FALSE    TRUE    NA's 
## logical    6552    2031       0
summary(duplicated(df3[,c(2,4)]))
##    Mode   FALSE    TRUE    NA's 
## logical    5633    1037       0
summary(duplicated(df4[,c(2,4)]))
##    Mode   FALSE    TRUE    NA's 
## logical    6731    1131       0
summary(duplicated(df5[,c(2,4)]))
##    Mode   FALSE    TRUE    NA's 
## logical    6550    1079       0
summary(duplicated(df20[,c(2,4)]))
##    Mode   FALSE    TRUE    NA's 
## logical    6784    1690       0
summary(duplicated(df30[,c(2,4)]))
##    Mode   FALSE    TRUE    NA's 
## logical    6289    1888       0
summary(duplicated(df40[,c(2,4)]))
##    Mode   FALSE    TRUE    NA's 
## logical    3831     424       0
summary(duplicated(df50[,c(2,4)]))
##    Mode   FALSE    TRUE    NA's 
## logical    4887    1122       0