This is a specific issue of the following dev version of dbplyr:
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)
Anybody has any idea? Also, I am not sure how I can reach @edgarauiz. Appreciate it if somebody could let him know. Thanks!