将 R 连接到 SQL Server 数据库引擎 [英] Connect R to a SQL Server database engine

查看:75
本文介绍了将 R 连接到 SQL Server 数据库引擎的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的工作中,我安装了 R-Studio(Microsoft R Open 3.2.5),并想连接到 Microsoft SQL Server 数据库,以使用我拥有的表运行脚本.

At my work I have R-Studio (Microsoft R Open 3.2.5) installed and would like to connect to a Microsoft SQL Server database, to run scripts using the tables I have.

我是否有可能使用 Pentaho 连接到 SQL Server 数据库,然后使用对象 Execute R-Script 来制作 OLAP Cube?我需要一个包来连接 SQL 引擎吗?要执行的步骤是什么?

Is there any chance that I can connect to a SQL Server database using Pentaho and then using the object Execute R-Script to make an OLAP Cube? Do I need a package to connect SQL engine? What would be the steps to perform?

我已经有了数据库的雪花结构.使用事实表和状态表.但我不知道从哪里开始.

I already have the snowflake arquitectura of the data base. With the fact table and the state tables. But I do not know where to start.

推荐答案

您可以使用至少 4 个库直接从 R 连接到 SQL Server (RODBCrsqlserverRSQLServer, RJDBC).

You can connect to SQL Server directly from R using at least 4 libraries (RODBC, rsqlserver, RSQLServer, RJDBC).

只要你有足够的内存,你就可以将你的数据导入 R 并在那里使用例如惊人的 dplyrdata.table 包.另一方面,您只需连接到 SQL Server 并将 SQL 查询发送到服务器并在数据库内进行数据整理,然后将结果导入 R 以进行进一步的(统计)分析和可视化.

As long as you have enough RAM, you can import your data into R and do your analysis there using for example amazing dplyr or data.table packages. On the other hand, you can just connect to SQL Server and send SQL queries to the server and do your data wrangling inside your database and then import results to R for further (statistical) analysis and visualization.

这篇关于将 R 连接到 SQL Server 数据库引擎的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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