I have some tweets and other variables that I would like to convert into a sparse matrix.
This is basically what my data looks like. Right now it is saved in a data.table with one column that contains the tweet and one column that contains the score.
Tweet Score
Sample Tweet :) 1
Different Tweet 0
I would like to convert this into a matrix that looks like this:
Score Sample Tweet Different :)
1 1 1 0 1
0 0 1 1 0
Where there is one row in the sparse matrix for each row in my data.table. Is there an easy way to do this in R?