dbplyr :: spread()在tbl_sql上的问题 [英] Issue with dbplyr::spread() on tbl_sql

查看:110
本文介绍了dbplyr :: spread()在tbl_sql上的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是以下dbplyr开发版本的特定问题:

This is a specific issue of the following dev version of dbplyr:

devtools :: install_github( tidyverse / dbplyr,ref = devtools :: github_pull(72 ))由@edgararuiz开发

devtools::install_github("tidyverse/dbplyr", ref = devtools::github_pull(72)) developed by @edgararuiz

在我看来,传播函数无法正常工作...

It seems to me that the spread function doesn't work properly...

df_sample <- tribble(~group1, ~group2, ~group3, ~identifier, ~value, 
                      8, 24, 6, 'mt_0', 
                      12, 18, 24, 6, 'mt_1', 4)

con <- DBI::dbConnect(RSQLite::SQLite(), ":memory:")
df_db <- copy_to(con, df_sample, 'df_sample')

我使用以下命令获得了不正确的结果。散布后应该只有一行数据。

I obtained an incorrect result with the following command. There should've been only one row of data after spread.

df_db %>% spread(identifier, value)

如果将原始数据下载到本地内存,则结果是正确的。

The result is correct if the original data is downloaded to local memory.

df_db %>% collect() %>% spread(identifier, value)

有人有什么主意吗?另外,我不确定如何到达@edgarauiz。如果有人可以告诉他,请多加赞赏。谢谢!

Anybody has any idea? Also, I am not sure how I can reach @edgarauiz. Appreciate it if somebody could let him know. Thanks!

推荐答案

我只是将其移植到GitHub。让作者来解决这个问题。

I just port this over to GitHub. Will let the author handle this.

这篇关于dbplyr :: spread()在tbl_sql上的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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