I have downloaded a file called "database.sqlite" from "https://www.kaggle.com/benhamner/d/kaggle/college-scorecard/exploring-the-us-college-scorecard-data" .I have to connect the database to R but i don't know how to run the file or create database and use the data from that file .I use mac and SQLite version is 3.8.5.Any help is highly appreciated.
Asked
Active
Viewed 136 times
0
-
You don't run a sqlite file. That's an actual database, you just read data from it using (insert sqlite database app here). – OneCricketeer Nov 17 '16 at 13:44
-
Oops ,android tag was a mistake. – Ajay Sadanand Nov 17 '16 at 13:46
-
That's fine. Your link already shows `library(RSQLite)` library, so AFAIK, that creates or opens a files on its own. – OneCricketeer Nov 17 '16 at 13:52
1 Answers
1
hi you can easily find a sample like this referenced from here
library("RSQLite")
con = dbConnect(drv="SQLite", dbname="country.sqlite")
alltables = dbListTables(con)
p1 = dbGetQuery( con,'select * from populationtable' )
p2 = dbGetQuery( con,'select count(*) from areastable' )
p3 = dbGetQuery(con, "SELECT population WHERE DATE(timeStamp) < DATE('now', 'weekday 0', '-7 days')")
dbClearResult(p3)
p4 = dbGetQuery(con, "select * from populationtable where jobdescription like '%manager%'")

Raghavendra
- 1,419
- 4
- 19
- 28