为什么在以下情况下传播无效?

时间:2019-04-28 07:13:37

标签: r tidyverse

我有以下数据

enter code here
    x = c('012015','012015','070956','070956','074351')
    y = c('011220','G20084','G20547','G20548','G70575')

df = as.data.frame(x)
df$y = y

我尝试了从tidyverse进行传播,但是它抛出错误“错误:行的标识符重复”

temp = df %>% spread(key = x, value = y)

In need result as below

0 个答案:

没有答案