从PostgreSQL导入文件到R [英] Importing files from PostgreSQL to R

查看:90
本文介绍了从PostgreSQL导入文件到R的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have a large data-set and I will preform some analysis in R software. While I could not import the data properly to R.

我收到此错误:


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

我已经使用PostgreSQL打开数据并以某种方式对其进行管理。如何将PostgreSQL中的现有数据导入R软件?

I have used PostgreSQL to open data and somehow manage it. How can I import the existing data in the PostgreSQL to the R software?

推荐答案

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

此外,应在R中安装 RPostgreSQL软件包。

Moreover, "RPostgreSQL" package in R should be installed.

这篇关于从PostgreSQL导入文件到R的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆