Lyric Sentiment Analysis R Package
For this assignment in ESM 262 Environmental Computing, we were asked to come up with a creative function, visualize the outputs, and then turn that function into a working package for public use.
My partner and I created a function that conducts a sentiment analysis on lyrics for songs in the top 100. The required input is an artist name (e.g. Madonna), and the output is a data frame which contains a column for that artists’ Top 100 song titles and a column for the sentiment values for those songs. Sentiment values range from -1 (negative sentiment) to 1 (positive sentiment).
Inputs include:
- artist: Artist name (required input)
- start_year: Start of date range
- end_year: End of date range
- dictionary: Dictionary for sentiment analysis (GI or QDAP)
- exact: Whether to look for exact artist match (impacts song features)
- duplicates: Whether to include duplicates (songs on top 100 for multiple years)
Installation:
- devtools::install_github(“laurenaceae/ESM262LH”)
- library(ESM262LH)
Example outputs (post-processed):
Collaborators: Sarah Lam (for both the function and package), Deanna Elliott (for only the package)