dd <- list(c("2020-1-2","SDF","fff,33"),
c("2020-1-3","KKK","ffd,23","fffdf,23","ssfds,43"))
dd
# [[1]]
# [1] "2020-1-2" "SDF" "fff,33"
# [[2]]
# [1] "2020-1-3" "KKK" "ffd,23" "fffdf,23" "ssfds,43"
ddtarget <- data.frame(date= c("2020-1-2","2020-1-3","2020-1-3","2020-1-3"),
category = c("SDF","KKK","KKK","KKK"),
element = c("fff,33","ffd,23","fffdf,23","ssfds,43"))
ddtarget
# date category element
# 1 2020-1-2 SDF fff,33
# 2 2020-1-3 KKK ffd,23
# 3 2020-1-3 KKK fffdf,23
# 4 2020-1-3 KKK ssfds,43
Я хочу преобразовать dd в ddtarget с помощью tidyverse, например map () или аналогичных функций, но я не могу сделать это самостоятельно. Может кто-нибудь мне помочь?