I have a list as follows:
yel <- list(c(1,3,5,7,9),
c(1,2,6,9),
c(2,4,5,6,7,8,9))
And I want to transform the list into a dataframe like the one below:
1 2 3
1 1 1 0
2 0 1 1
3 1 0 0
4 0 0 1
5 1 0 1
6 0 1 1
7 1 0 1
8 0 0 1
9 1 1 1
To give an idea of how I arrived with that list: I have a dataframe with 2 columns namely "id" and "text". The "text" column is a list of characters. I found the unique words in the character list and created a data frame "yel" where the first list represents the "id" which has "text1", second list represents "id" which has "text2" and so on. (The "id" in my dataset for example is 7170325). Thank you very much in advance !