#attempting to spread tbl_dbi and tbl_sql without downloading to local memory

//this does not work
df_db %>% spread(identifier, value)
Error in UseMethod("spread_") :
no applicable method for 'spread_' applied to an object of class "c('tbl_dbi', 'tbl_sql', 'tbl_lazy', 'tbl')"

#attempting to spread tbl_dbi and tbl_sql after downloading to local memory

//this spreads the data but the output is in memory
//I would like to keep the output as 'tbl_dbi', 'tbl_sql', and 'tbl_lazy'
df_db %<>% collect() %>% spread(identifier, value)
class(df_db)
[1] "tbl_df" "tbl" "data.frame"

Can you please elaborate on your use case? What do the key and value columns contain? An iteration over columns usually can be replaced with a grouped operation on the corresponding long-form dataset, this should work pretty well on the database.
– krlmlrMar 12 at 22:55

Thanks, @krlmlr. key=identifier, value=value. Normal data. Just large. Could you kindly share an example of your thoughts as an answer?
– KrantzMar 14 at 2:01

What are the operations you want to perform on the "wide" dataset?
– krlmlrMar 14 at 8:00