gpt4 book ai didi

r - 将文件从 PostgreSQL 导入到 R

转载 作者:行者123 更新时间:2023-11-29 11:11:31 25 4
gpt4 key购买 nike

我有一个大型数据集,我将在 R 软件中执行一些分析。虽然我无法将数据正确导入 R。

我收到这个错误:

Error in postgresqlNewConnection(drv, ...) : RS-DBI driver: (could not connect User@local on dbname "Intel"

我使用 PostgreSQL 打开数据并以某种方式管理它。如何将PostgreSQL中已有的数据导入到R软件中?

最佳答案

drv <- dbDriver("PostgreSQL")
con <- dbConnect(drv, host='localhost', port='5432', dbname='Swiss',
user='postgres', password='123456')

此外,应该安装R中的“RPostgreSQL”包。

关于r - 将文件从 PostgreSQL 导入到 R,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12490863/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com