Reputation: 1
I've used the spread
function in tidyverse before, and it worked fine. Now, however, it raises this error message for all uses of the spread function:
df <- data_frame(x = c('a', 'b'), y = 1:2)
df %>% spread(x, y)
Error in synthetic.instrument(primary_id = primary_id, currency = currency, : object 'y' not found
Error in synthetic.instrument(primary_id = primary_id, currency = currency, : argument "memberratio" is missing, with no default
What is causing the error?
Upvotes: 0
Views: 195
Reputation: 1
From what I managed to find about this topic on the net, I think the source of your problem might be due to the recent changes in tidyverse library. Trying out the pivot_wider() function in place of the spread function might work in your favor.
Something like this could work:
d_frame <- data_frame(x = c('a', 'b'), y = 1:2)
d_frame %>% pivot_wider(names_from = x, values_from = y)
Upvotes: 0