是因为没有找到数据库,example code里边有个typo。
system.file("extdata", "bb.db", package="
nutshell.bbdb") #sqlite db filename的绝对路径,你可以去你系统查找这个文件名
,确认它存在不存在。
package="nutshell"
应该是
package="nutshell.bbdb"
同时确认你安装了nutshell R package.
RSQLite版本更新很快,建议看最新的RSQLite的文档。
> library(RSQLite)
Loading required package: DBI
> drv> con nutshell.bbdb"))
> dbListTables(con)
[1] "Allstar" "AllstarFull" "Appearances"
[4] "AwardsManagers" "AwardsPlayers" "AwardsShareManagers"
[7] "AwardsSharePlayers" "Batting" "BattingPost"
[10] "Fielding" "FieldingOF" "FieldingPost"
[13] "HOFold" "HallOfFame" "Managers"
[16] "ManagersHalf" "Master" "Pitching"
[19] "PitchingPost" "Salaries" "Schools"
[22] "SchoolsPlayers" "SeriesPost" "Teams"
[25] "TeamsFranchises" "TeamsHalf" "xref_stats"