1

I have a dataframe that contains word frequencies in each poem of a poet. For each row, there is information with the word, frequency, poem name, and year written. I want to use aggregate to change my df so it has the word frequencies based on the year, not the poem.

I have nulled the title column, but I keep playing around with aggregate and can't come up with a solution.

What I have so far is (calling my csv file df)

new.df<-aggregate(x = df, by = list(df$year,df$word,df$freq,FUN = frequency)

This is obviously way off and isn't working... I'm self-teaching myself this so any help would be appreciated!

Erin Fick
  • 11
  • 1

0 Answers0