RS-DBI驱动程序:(无法连接user@localhost:5432在dbname“lahman”上:致命:数据库“lahman”不存在

RS-DBI驱动程序:(无法连接user@localhost:5432在dbname“lahman”上:致命:数据库“lahman”不存在,r,dbplyr,R,Dbplyr,我正试图让dbplyr中的lahman\u postgres()示例正常工作,但我还没有成功做到这一点: 库(dbplyr) lahman_postgres() #>postgresqlNewConnection(drv,…)中出错:RS-DBI驱动程序:(无法连接)bs@localhost:5432在dbname“lahman”上:致命:数据库“lahman”不存在 #> ) lahman_sqlite() #>创建表:AllstarFull #>创建表:外观 #>创建表:AwardsMana

我正试图让
dbplyr
中的
lahman\u postgres()
示例正常工作,但我还没有成功做到这一点:

库(dbplyr)
lahman_postgres()
#>postgresqlNewConnection(drv,…)中出错:RS-DBI驱动程序:(无法连接)bs@localhost:5432在dbname“lahman”上:致命:数据库“lahman”不存在
#> )
lahman_sqlite()
#>创建表:AllstarFull
#>创建表:外观
#>创建表:AwardsManager
#>创建表格:AwardsPlayers
#>创建表:AwardsShareManager
#>创建表:AwardsSharePlayers
#>创建表格:击球
#>创建表格:BattingPost
#>创建表格:CollegePlaying
#>创建表:Fielding
#>创建表:FieldingOF
#>创建表:FieldingPost
#>创建表:HallOfFame
#>创建表:lahmanadata
#>创建表:管理器
#>创建表:ManagersHalf
#>创建表:主控
#>创建表:公园
#>创建表格:人
#>创建表格:投球
#>创建表:PitchingPost
#>创建表格:工资
#>创建表格:学校
#>创建表:SeriePost
#>创建表格:团队
#>创建表:TeamsFanchises
#>创建表:TeamsHalf
#>src:sqlite 3.29.0[/var/folders/x8/gt429559287f1y6tjjtyc9vw0000gn/T//RtmpF1A7Xj/lahman.sqlite]
#>tbls:AllstarFull、出场、获奖管理者、获奖展示者、,
#>获奖者共享管理员,获奖者共享者,击球,击球杆,
#>大学比赛,防守,防守,防守,
#>拉赫曼数据、经理、经理半身、大师、公园、人员、投球、,
#>投手职位、薪水、学校、服务职位、sqlite_stat1、sqlite_stat4、,
#>团队,团队牧场,团队沙拉夫
由(v0.3.0)于2019-07-31创建

Postgres驱动程序设置似乎正在运行:

dplyr::src_postgres()
#>src:postgres 11.4.0[bs@localhost:5432/bs]
#>TBL:航空公司、机场、航班、天气
由(v0.3.0)于2019-07-31创建


关于我可能缺少的步骤有什么想法吗?

如果仔细查看
lahman_postgres()
的实现,您会注意到它默认使用不同的参数调用
src_postgres()

dbplyr::lahman_postgres
#>函数(dbname=“lahman”,host=“localhost”,…){
#>src副本_lahman(src)
#> }
#> 
#> 
由(v0.3.0)于2019-08-05创建

要解决一般错误,我建议使用
选项(error=recover)
或使用启用rlang的回溯