I have some trouble converting my data.frame from long to wide.
My data looks like this:
Book Word Sentiment
AAA word1 Fear
AAA word2 Joy
BBB word3 Trust
BBB word4 Joy
CCC word5 Trust
CCC word6 Trust
I need to create this (considering the count of occurrences of the unique Sentiments and avoiding the 'word' column):
Book Fear Trust Joy
AAA 1 0 1
BBB 0 1 1
CCC 0 2 0
I'm using R.