This database is bundled with the package, and contains all data frames in the reclues package. If called it returns the connection to the SQLite DB which can then be used to get more information, run queries etc.

get_db()

Value

A connection to the sql-murder-mystery.db which is a SQLite database provided by `@knightlab`

Examples

library(DBI) library(dplyr)
#> #> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats': #> #> filter, lag
#> The following objects are masked from 'package:base': #> #> intersect, setdiff, setequal, union
db <- reclues::get_db() DBI::dbListTables(db)
#> [1] "crime_scene_report" "drivers_license" "facebook_event_checkin" #> [4] "get_fit_now_check_in" "get_fit_now_member" "income" #> [7] "interview" "person" "solution"
DBI::dbGetQuery(db, "SELECT * FROM crime_scene_report LIMIT 10")
#> date type #> 1 20180115 robbery #> 2 20180115 murder #> 3 20180115 murder #> 4 20180215 murder #> 5 20180215 murder #> 6 20180115 theft #> 7 20180115 fraud #> 8 20170712 theft #> 9 20170820 arson #> 10 20171110 robbery #> description #> 1 A Man Dressed as Spider-Man Is on a Robbery Spree #> 2 Life? Dont talk to me about life. #> 3 Mama, I killed a man, put a gun against his head... #> 4 REDACTED REDACTED REDACTED #> 5 Someone killed the guard! He took an arrow to the knee! #> 6 Big Bully stole my lunch money! #> 7 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do\n eiusmod tempor incididunt ut labore et dolore magna aliqua. #> 8 A lone hunter stalks the night, firing arrows into the Darkness.\n There is no hiding, no escape. In the distance, the beast\n falters, tethered to the void. The killing blow comes without\n hesitation, without mercy. #> 9 Wield the Hammer of Sol with honor, Titan, it is a thing of\n legend, both past and future. #> 10 The Gjallarhorn shoulder-mounted rocket system was forged from\n the armor of Guardians who fell at the Twilight Gap. Gifted\n to the survivors of that terrible battle, the Gjallarhorn\n is seen as a symbol of honor and survival. #> city #> 1 NYC #> 2 Albany #> 3 Reno #> 4 SQL City #> 5 SQL City #> 6 Chicago #> 7 Seattle #> 8 SQL City #> 9 SQL City #> 10 SQL City
# Use dplyr to connect to the database and view a few of the entries in the table dplyr::tbl(db, "crime_scene_report")
#> # Source: table<crime_scene_report> [?? x 4] #> # Database: sqlite 3.29.0 #> # [C:\Users\vebashini\AppData\Local\Temp\Rtmpi0R3pJ\temp_libpath4647c3c2f19\reclues\db\sql-murder-mystery.db] #> date type description city #> <int> <chr> <chr> <chr> #> 1 20180115 robbery A Man Dressed as Spider-Man Is on a Robbery Spree NYC #> 2 20180115 murder Life? Dont talk to me about life. Albany #> 3 20180115 murder Mama, I killed a man, put a gun against his head... Reno #> 4 20180215 murder REDACTED REDACTED REDACTED SQL C~ #> 5 20180215 murder Someone killed the guard! He took an arrow to the kn~ SQL C~ #> 6 20180115 theft Big Bully stole my lunch money! Chica~ #> 7 20180115 fraud "Lorem ipsum dolor sit amet, consectetur adipiscing ~ Seatt~ #> 8 20170712 theft "A lone hunter stalks the night, firing arrows into ~ SQL C~ #> 9 20170820 arson "Wield the Hammer of Sol with honor, Titan, it is a ~ SQL C~ #> 10 20171110 robbery "The Gjallarhorn shoulder-mounted rocket system was ~ SQL C~ #> # ... with more rows
DBI::dbDisconnect(db)