Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql server 如何在R中将SQL Server表作为矩阵读取_Sql Server_R_Matrix - Fatal编程技术网

Sql server 如何在R中将SQL Server表作为矩阵读取

Sql server 如何在R中将SQL Server表作为矩阵读取,sql-server,r,matrix,Sql Server,R,Matrix,我在SQL Server中有一个表,如下所示: ID ID1 ID2 1 4 7 2 2 6 我使用SQL Server中的PIVOT创建该表 现在,我想操纵R中的矩阵,所以我有: 库(RODBC) 是否删除第一列dat@Cedric,因为它是pivot表中的一个矩阵,所以删除第一列和头应该会留下2X2矩阵。我试过dat@Cedric,它奏效了,我有一个打字错误。似乎Solve(dat)考虑了标题删除第一列dat@Cedric,因为它是piv

我在SQL Server中有一个表,如下所示:

ID    ID1    ID2
1      4      7
2      2      6
我使用SQL Server中的
PIVOT
创建该表

现在,我想操纵R中的矩阵,所以我有:

库(RODBC)

是否删除第一列
dat@Cedric,因为它是pivot表中的一个矩阵,所以删除第一列和头应该会留下2X2矩阵。我试过
dat@Cedric,它奏效了,我有一个打字错误。似乎Solve(dat)考虑了标题删除第一列
dat@Cedric,因为它是pivot表中的一个矩阵,所以删除第一列和头应该会留下2X2矩阵。我试过
dat@Cedric,它奏效了,我有一个打字错误。似乎Solve(dat)考虑了头