beanumber / baseball_R

Companion to Analyzing Baseball Data with R, 2nd edition
95 stars 62 forks source link

Chapter 7.2 - pitchRx Data Issue #12

Closed aireste closed 2 years ago

aireste commented 3 years ago

Having issues with the first step in 7.2 where we create an empty SQLite database using src_sqlite()

db <- src_sqlite("~/Desktop/Data Analysis/Analyzing Baseball Data with R/baseball_R/data/pitchrx.sqlite", create = TRUE) this code leads to the error: Error in (function (cond) : error in evaluating the argument 'drv' in selecting a method for function 'dbConnect': there is no package called ‘RSQLite’

I then use the tbl() function which was prompted since src_sqlite is not available anymore: db <- tbl("~/Desktop/Data Analysis/Analyzing Baseball Data with R/baseball_R/data/pitchrx.sqlite", create = TRUE) which then leads to the error: Error in UseMethod("tbl") : no applicable method for 'tbl' applied to an object of class "character"

I'm curious if I entered the wrong arguments in the tbl() function, or if there is another way to get through this.

beanumber commented 2 years ago

You need to install the RSQLite package. That should solve your problem.