Going Down to South Park, Part 1: Text Analysis with R
Have you ever liked a TV show so much that simply watching it wasn’t enough anymore? Read on to discover how I used R to analyze South Park dialog and ratings!
South Park is an American TV show for adults that’s well known for being very satirical—the series has made fun of nearly every celebrity and isn’t afraid to be provocative.
I literally watch the show every day. I also do lots of data analysis in R every day! Naturally, I wondered why I haven’t analyzed South Park yet… What’s the overall sentiment of the show? How does the popularity of its episodes evolve over time? Who’s the naughtiest character? Or are naughty episodes more popular?
I’ll answer some of these questions in this article. In future articles, I’ll apply some other data science methodologies to analyze South Park characters.
First things first
I had to find a resource with all the text for South Park dialog in a reasonable format. It took just a bit of Googling to find a gold mine: the South Park archives, a wiki page with community-maintained scripts for all episodes. Awesome!
The archive has a list of seasons and their episodes. Each episode page has a nice table with two columns—the first denoting the character’s name, and the second containing the actual line the character said. This is a perfect start.
There was one more thing I wanted to know about each episode: their popularity! I’m sure you’re familiar with IMDB (the Internet Movie Database); it contains the ratings of all movies and TV shows known to man.
But how do I put all this data together? Well, I wrote an R package called southparkr that anyone can use to analyze this data. That package downloads all the information described above and makes it conveniently available, allowing you to simply focus on analyzing the data.
Data acquired. Engage!
The second step was to determine what exactly I wanted to analyze. And for this article, I decided on doing two things:
- Conducting a sentiment analysis of South Park dialog.
- Determining episode popularity based on IMDB ratings.
We’ll get to these in a minute. We should first have a look at some summary statistics for the data we’ve acquired. The table below has some basic South Park stats:
Number of seasons: | 21 |
Number of episodes: | 287 |
Number of words: | 907 797 |
No stopwords (a, the, this, …): | 310 759 |
% used for analysis: | 34.23 |
Average IMDB rating: | 8.14 |
Best episode (9.6): | Scott Tenorman Must Die S05E04 |
Worst episode (6.3): | Funnybot S15E02 |
You can see that the show has been running for a solid 21 seasons. All the characters combined have said nearly 1 million words! Of course, that’s if we count all words. If we exclude stop words (prepositions, articles, etc.), we end up with about 300,000 words.
The episodes have sustained an average rating of roughly 8.1, which is great! (I always consider anything above an 8 worth watching.) You can also see the best and worst episodes in that table above, in case you’re interested in checking those out.
Let’s get sentimental… and dirty!
We’ll tackle the first analysis now. Sentiment analysis involves analyzing and scoring text based on context, patterns, or other characteristics within the text. These scores are positive and negative and can be expressed with numbers or words.
We’ll be using the AFINN dictionary, which scores words from -5 to 5 (where -5 is a very negative word, 0 is neutral, and +5 is very positive). For example, we’d rank bastard (and more vulgar words) as -5 and thrilled as +5.
All of this has been prepared for you behind the curtains. You’ll now see a few lines of code in R that produce a sentiment score for all episodes:
gg<- ggplot(by_episode, aes(x = episode_number, y = mean_sentiment_score, group = 1, text = text_sent)) + geom_col(color = "#592a88") + geom_smooth() ggplotly(gg, tooltip = "text")
Episode number: S01E01
Mean sentiment score: -0.96","Episode name: Volcano
Episode number: S01E03
Mean sentiment score: -1","Episode name: Big Gay Al's Big Gay Boat Ride
Episode number: S01E04
Mean sentiment score: -0.12","Episode name: An Elephant Makes Love to a Pig
Episode number: S01E05
Mean sentiment score: -0.72","Episode name: Death
Episode number: S01E06
Mean sentiment score: -1.08","Episode name: Pinkeye
Episode number: S01E07
Mean sentiment score: -0.91","Episode name: Starvin' Marvin
Episode number: S01E08
Mean sentiment score: -0.54","Episode name: Mr. Hankey, the Christmas Poo
Episode number: S01E09
Mean sentiment score: -1.02","Episode name: Damien
Episode number: S01E10
Mean sentiment score: -0.39","Episode name: Tom's Rhinoplasty
Episode number: S01E11
Mean sentiment score: -0.07","Episode name: Mecha-Streisand
Episode number: S01E12
Mean sentiment score: -0.78","Episode name: Cartman's Mom is a Dirty Slut
Episode number: S01E13
Mean sentiment score: -0.37","Episode name: Terrance and Phillip in Not Without My Anus
Episode number: S02E01
Mean sentiment score: -0.76","Episode name: Cartman's Mom is Still a Dirty Slut
Episode number: S02E02
Mean sentiment score: -0.45","Episode name: Chickenlover
Episode number: S02E03
Mean sentiment score: -0.58","Episode name: Ike's Wee Wee
Episode number: S02E04
Mean sentiment score: -0.93","Episode name: The Mexican Staring Frog of Southern Sri Lanka
Episode number: S02E06
Mean sentiment score: -0.71","Episode name: City on the Edge of Forever
Episode number: S02E07
Mean sentiment score: -0.88","Episode name: Summer Sucks
Episode number: S02E08
Mean sentiment score: -1.1","Episode name: Chef's Chocolate Salty Balls
Episode number: S02E09
Mean sentiment score: -0.66","Episode name: Chickenpox
Episode number: S02E10
Mean sentiment score: -0.72","Episode name: Roger Ebert Should Lay off the Fatty Foods
Episode number: S02E11
Mean sentiment score: -0.1","Episode name: Clubhouses
Episode number: S02E12
Mean sentiment score: -0.85","Episode name: Cow Days
Episode number: S02E13
Mean sentiment score: -0.02","Episode name: Chef Aid
Episode number: S02E14
Mean sentiment score: -0.09","Episode name: Spookyfish
Episode number: S02E15
Mean sentiment score: -0.63","Episode name: Merry Christmas Charlie Manson!
Episode number: S02E16
Mean sentiment score: -0.34","Episode name: Gnomes
Episode number: S02E17
Mean sentiment score: -0.47","Episode name: Prehistoric Ice Man
Episode number: S02E18
Mean sentiment score: -0.68","Episode name: Rainforest Shmainforest
Episode number: S03E01
Mean sentiment score: -0.36","Episode name: Spontaneous Combustion
Episode number: S03E02
Mean sentiment score: -0.53","Episode name: The Succubus
Episode number: S03E03
Mean sentiment score: -0.52","Episode name: Tweek vs. Craig
Episode number: S03E05
Mean sentiment score: -0.54","Episode name: Sexual Harassment Panda
Episode number: S03E06
Mean sentiment score: -0.77","Episode name: Cat Orgy
Episode number: S03E07
Mean sentiment score: -0.43","Episode name: Two Guys Naked in a Hot Tub
Episode number: S03E08
Mean sentiment score: -0.1","Episode name: Jewbilee
Episode number: S03E09
Mean sentiment score: -0.37","Episode name: Korn's Groovy Pirate Ghost Mystery
Episode number: S03E10
Mean sentiment score: -0.48","Episode name: Chinpokomon
Episode number: S03E11
Mean sentiment score: -0.56","Episode name: Hooked on Monkey Fonics
Episode number: S03E12
Mean sentiment score: -0.25","Episode name: Starvin' Marvin in Space
Episode number: S03E13
Mean sentiment score: -0.03","Episode name: The Red Badge of Gayness
Episode number: S03E14
Mean sentiment score: -0.49","Episode name: World Wide Recorder Concert
Episode number: S03E17
Mean sentiment score: -0.27","Episode name: The Tooth Fairy Tats 2000
Episode number: S04E01
Mean sentiment score: -0.52","Episode name: Cartman's Silly Hate Crime 2000
Episode number: S04E02
Mean sentiment score: -0.95","Episode name: Timmy 2000
Episode number: S04E03
Mean sentiment score: -0.22","Episode name: Quintuplets 2000
Episode number: S04E04
Mean sentiment score: -0.35","Episode name: Cherokee Hair Tampons
Episode number: S04E06
Mean sentiment score: -0.13","Episode name: Chef Goes Nanners
Episode number: S04E07
Mean sentiment score: -0.29","Episode name: Something You Can Do with Your Finger
Episode number: S04E08
Mean sentiment score: -0.22","Episode name: Do the Handicapped Go to Hell?
Episode number: S04E09
Mean sentiment score: -0.79","Episode name: Probably
Episode number: S04E10
Mean sentiment score: -0.42","Episode name: Fourth Grade
Episode number: S04E11
Mean sentiment score: -0.2","Episode name: Trapper Keeper
Episode number: S04E12
Mean sentiment score: -0.47","Episode name: Helen Keller! The Musical
Episode number: S04E13
Mean sentiment score: -0.18","Episode name: Fat Camp
Episode number: S04E15
Mean sentiment score: -0.58","Episode name: The Wacky Molestation Adventure
Episode number: S04E16
Mean sentiment score: -0.62","Episode name: It Hits the Fan
Episode number: S05E01
Mean sentiment score: -1.98","Episode name: Scott Tenorman Must Die
Episode number: S05E04
Mean sentiment score: -0.2","Episode name: Terrance and Phillip: Behind the Blow
Episode number: S05E05
Mean sentiment score: -0.06","Episode name: Cartmanland
Episode number: S05E06
Mean sentiment score: -0.14","Episode name: Towelie
Episode number: S05E08
Mean sentiment score: -0.58","Episode name: Osama bin Laden Has Farty Pants
Episode number: S05E09
Mean sentiment score: -1.08","Episode name: The Entity
Episode number: S05E11
Mean sentiment score: -0.62","Episode name: Kenny Dies
Episode number: S05E13
Mean sentiment score: -0.42","Episode name: Butters' Very Own Episode
Episode number: S05E14
Mean sentiment score: -0.21","Episode name: Jared Has Aides
Episode number: S06E01
Mean sentiment score: -0.44","Episode name: Freak Strike
Episode number: S06E03
Mean sentiment score: -0.21","Episode name: Fun with Veal
Episode number: S06E04
Mean sentiment score: -0.65","Episode name: The New Terrance and Phillip Movie Trailer
Episode number: S06E05
Mean sentiment score: -0.14","Episode name: Professor Chaos
Episode number: S06E06
Mean sentiment score: -0.09","Episode name: The Simpsons Already Did It
Episode number: S06E07
Mean sentiment score: -0.16","Episode name: Red Hot Catholic Love
Episode number: S06E08
Mean sentiment score: -0.16","Episode name: Bebe's Boobs Destroy Society
Episode number: S06E10
Mean sentiment score: -0.36","Episode name: Child Abduction is Not Funny
Episode number: S06E11
Mean sentiment score: -0.51","Episode name: A Ladder to Heaven
Episode number: S06E12
Mean sentiment score: -0.3","Episode name: The Return of the Fellowship of the Ring to the Two Towers
Episode number: S06E13
Mean sentiment score: -0.12","Episode name: The Death Camp of Tolerance
Episode number: S06E14
Mean sentiment score: -0.56","Episode name: The Biggest Douche in the Universe
Episode number: S06E15
Mean sentiment score: -0.7","Episode name: My Future Self n' Me
Episode number: S06E16
Mean sentiment score: -0.57","Episode name: Cancelled
Episode number: S07E01
Mean sentiment score: -0.25","Episode name: Toilet Paper
Episode number: S07E03
Mean sentiment score: -0.68","Episode name: I'm a Little Bit Country
Episode number: S07E04
Mean sentiment score: -0.74","Episode name: Fat Butt and Pancake Head
Episode number: S07E05
Mean sentiment score: -0.04","Episode name: Lil' Crime Stoppers
Episode number: S07E06
Mean sentiment score: -0.62","Episode name: Grey Dawn
Episode number: S07E10
Mean sentiment score: -0.9","Episode name: All About Mormons
Episode number: S07E12
Mean sentiment score: -0.72","Episode name: Butt Out
Episode number: S07E13
Mean sentiment score: -0.81","Episode name: It's Christmas in Canada
Episode number: S07E15
Mean sentiment score: -0.56","Episode name: Good Times with Weapons
Episode number: S08E01
Mean sentiment score: -0.51","Episode name: The Passion of the Jew
Episode number: S08E03
Mean sentiment score: -0.53","Episode name: You Got F'd in the A
Episode number: S08E04
Mean sentiment score: -0.17","Episode name: The Jeffersons
Episode number: S08E06
Mean sentiment score: -0.26","Episode name: Goobacks
Episode number: S08E07
Mean sentiment score: -0.49","Episode name: Douche and Turd
Episode number: S08E08
Mean sentiment score: -1.09","Episode name: Something Wall-Mart This Way Comes
Episode number: S08E09
Mean sentiment score: -0.58","Episode name: Pre-School
Episode number: S08E10
Mean sentiment score: -0.37","Episode name: Stupid Spoiled Whore Video Playset
Episode number: S08E12
Mean sentiment score: -0.95","Episode name: Cartman's Incredible Gift
Episode number: S08E13
Mean sentiment score: -0.38","Episode name: Woodland Critter Christmas
Episode number: S08E14
Mean sentiment score: -0.31","Episode name: Die Hippie, Die
Episode number: S09E02
Mean sentiment score: -0.13","Episode name: Best Friends Forever
Episode number: S09E04
Mean sentiment score: -0.23","Episode name: The Losing Edge
Episode number: S09E05
Mean sentiment score: -0.15","Episode name: The Death of Eric Cartman
Episode number: S09E06
Mean sentiment score: -0.48","Episode name: Two Days Before the Day After Tomorrow
Episode number: S09E08
Mean sentiment score: -0.53","Episode name: Marjorine
Episode number: S09E09
Mean sentiment score: -0.59","Episode name: Follow That Egg!
Episode number: S09E10
Mean sentiment score: -0.23","Episode name: Ginger Kids
Episode number: S09E11
Mean sentiment score: -0.54","Episode name: Trapped in the Closet
Episode number: S09E12
Mean sentiment score: -0.11","Episode name: Smug Alert!
Episode number: S10E02
Mean sentiment score: -0.05","Episode name: Cartoon Wars Part I
Episode number: S10E03
Mean sentiment score: -0.41","Episode name: Cartoon Wars Part II
Episode number: S10E04
Mean sentiment score: -0.72","Episode name: A Million Little Fibers
Episode number: S10E05
Mean sentiment score: -0.51","Episode name: ManBearPig
Episode number: S10E06
Mean sentiment score: -0.45","Episode name: Tsst
Episode number: S10E07
Mean sentiment score: -0.16","Episode name: Make Love, Not Warcraft
Episode number: S10E08
Mean sentiment score: -0.56","Episode name: Mystery of the Urinal Deuce
Episode number: S10E09
Mean sentiment score: -0.44","Episode name: Miss Teacher Bangs a Boy
Episode number: S10E10
Mean sentiment score: -2.4","Episode name: Hell on Earth 2006
Episode number: S10E11
Mean sentiment score: -0.95","Episode name: Go God Go
Episode number: S10E12
Mean sentiment score: -0.55","Episode name: Go God Go XII
Episode number: S10E13
Mean sentiment score: -0.57","Episode name: With Apologies to Jesse Jackson
Episode number: S11E01
Mean sentiment score: -1.31","Episode name: Cartman Sucks
Episode number: S11E02
Mean sentiment score: -0.08","Episode name: Lice Capades
Episode number: S11E03
Mean sentiment score: -0.77","Episode name: The Snuke
Episode number: S11E04
Mean sentiment score: -0.27","Episode name: Fantastic Easter Special
Episode number: S11E05
Mean sentiment score: -0.23","Episode name: D-Yikes!
Episode number: S11E06
Mean sentiment score: -0.33","Episode name: Night of the Living Homeless
Episode number: S11E07
Mean sentiment score: -0.4","Episode name: Le Petit Tourette
Episode number: S11E08
Mean sentiment score: -1.41","Episode name: More Crap
Episode number: S11E09
Mean sentiment score: -0.54","Episode name: Imaginationland
Episode number: S11E10
Mean sentiment score: -0.73","Episode name: Imaginationland, Episode II
Episode number: S11E11
Mean sentiment score: -0.9","Episode name: Imaginationland, Episode III
Episode number: S11E12
Mean sentiment score: -0.49","Episode name: Tonsil Trouble
Episode number: S12E01
Mean sentiment score: -0.19","Episode name: Britney's New Look
Episode number: S12E02
Mean sentiment score: -0.79","Episode name: Major Boobage
Episode number: S12E03
Mean sentiment score: -1.03","Episode name: Canada on Strike
Episode number: S12E04
Mean sentiment score: -0.29","Episode name: Eek, A Penis!
Episode number: S12E05
Mean sentiment score: -0.46","Episode name: Over Logging
Episode number: S12E06
Mean sentiment score: -0.42","Episode name: The China Probrem
Episode number: S12E08
Mean sentiment score: -0.87","Episode name: Breast Cancer Show Ever
Episode number: S12E09
Mean sentiment score: -1.05","Episode name: Pandemic
Episode number: S12E10
Mean sentiment score: -0.42","Episode name: Pandemic 2: The Startling
Episode number: S12E11
Mean sentiment score: -0.45","Episode name: Elementary School Musical
Episode number: S12E13
Mean sentiment score: -0.1","Episode name: The Ungroundable
Episode number: S12E14
Mean sentiment score: -0.51","Episode name: The Coon
Episode number: S13E02
Mean sentiment score: -1.09","Episode name: Margaritaville
Episode number: S13E03
Mean sentiment score: -0.32","Episode name: Eat, Pray, Queef
Episode number: S13E04
Mean sentiment score: -0.09","Episode name: Pinewood Derby
Episode number: S13E06
Mean sentiment score: -0.33","Episode name: Fatbeard
Episode number: S13E07
Mean sentiment score: -0.3","Episode name: Dead Celebrities
Episode number: S13E08
Mean sentiment score: -0.8","Episode name: Butters' Bottom Bitch
Episode number: S13E09
Mean sentiment score: -0.96","Episode name: W.T.F.
Episode number: S13E10
Mean sentiment score: -0.81","Episode name: Whale Whores
Episode number: S13E11
Mean sentiment score: -0.58","Episode name: The F Word
Episode number: S13E12
Mean sentiment score: -0.88","Episode name: Dances with Smurfs
Episode number: S13E13
Mean sentiment score: -0.81","Episode name: Pee
Episode number: S13E14
Mean sentiment score: -0.64","Episode name: Sexual Healing
Episode number: S14E01
Mean sentiment score: -0.51","Episode name: The Tale of Scrotie McBoogerballs
Episode number: S14E02
Mean sentiment score: -0.81","Episode name: Medicinal Fried Chicken
Episode number: S14E03
Mean sentiment score: -0.48","Episode name: 200
Episode number: S14E05
Mean sentiment score: -0.65","Episode name: 201
Episode number: S14E06
Mean sentiment score: -0.08","Episode name: Crippled Summer
Episode number: S14E07
Mean sentiment score: -0.66","Episode name: Poor and Stupid
Episode number: S14E08
Mean sentiment score: -0.8","Episode name: It's a Jersey Thing
Episode number: S14E09
Mean sentiment score: -0.93","Episode name: Insheeption
Episode number: S14E10
Mean sentiment score: -0.26","Episode name: Coon 2: Hindsight
Episode number: S14E11
Mean sentiment score: -0.4","Episode name: Mysterion Rises
Episode number: S14E12
Mean sentiment score: -0.89","Episode name: Coon vs. Coon & Friends
Episode number: S14E13
Mean sentiment score: -1.02","Episode name: HUMANCENTiPAD
Episode number: S15E01
Mean sentiment score: -0.35","Episode name: Royal Pudding
Episode number: S15E03
Mean sentiment score: -0.82","Episode name: T.M.I.
Episode number: S15E04
Mean sentiment score: -1.49","Episode name: Crack Baby Athletic Association
Episode number: S15E05
Mean sentiment score: -0.38","Episode name: City Sushi
Episode number: S15E06
Mean sentiment score: -1.1","Episode name: You're Getting Old
Episode number: S15E07
Mean sentiment score: -1.19","Episode name: Ass Burgers
Episode number: S15E08
Mean sentiment score: -0.42","Episode name: The Last of the Meheecans
Episode number: S15E09
Mean sentiment score: -0.31","Episode name: Bass to Mouth
Episode number: S15E10
Mean sentiment score: -0.57","Episode name: 1%
Episode number: S15E12
Mean sentiment score: -1.04","Episode name: A History Channel Thanksgiving
Episode number: S15E13
Mean sentiment score: -0.04","Episode name: The Poor Kid
Episode number: S15E14
Mean sentiment score: -0.44","Episode name: Reverse Cowgirl
Episode number: S16E01
Mean sentiment score: -0.94","Episode name: Cash For Gold
Episode number: S16E02
Mean sentiment score: -0.71","Episode name: Faith Hilling
Episode number: S16E03
Mean sentiment score: -0.02","Episode name: Butterballs
Episode number: S16E05
Mean sentiment score: -1.19","Episode name: I Should Have Never Gone Ziplining
Episode number: S16E06
Mean sentiment score: -0.82","Episode name: Raising the Bar
Episode number: S16E09
Mean sentiment score: -1.32","Episode name: Insecurity
Episode number: S16E10
Mean sentiment score: -0.59","Episode name: Going Native
Episode number: S16E11
Mean sentiment score: -0.3","Episode name: A Scause For Applause
Episode number: S16E13
Mean sentiment score: -0.52","Episode name: Let Go, Let Gov
Episode number: S17E01
Mean sentiment score: -0.23","Episode name: Informative Murder Porn
Episode number: S17E02
Mean sentiment score: -1.08","Episode name: World War Zimmerman
Episode number: S17E03
Mean sentiment score: -0.62","Episode name: Goth Kids 3: Dawn of the Posers
Episode number: S17E04
Mean sentiment score: -1.35","Episode name: Taming Strange
Episode number: S17E05
Mean sentiment score: -0.16","Episode name: A Song of Ass and Fire
Episode number: S17E08
Mean sentiment score: -0.61","Episode name: Titties and Dragons
Episode number: S17E09
Mean sentiment score: -0.34","Episode name: Gluten Free Ebola
Episode number: S18E02
Mean sentiment score: -0.13","Episode name: The Cissy
Episode number: S18E03
Mean sentiment score: -0.16","Episode name: Handicar
Episode number: S18E04
Mean sentiment score: -0.67","Episode name: The Magic Bush
Episode number: S18E05
Mean sentiment score: -1.02","Episode name: Freemium Isn't Free
Episode number: S18E06
Mean sentiment score: -0.1","Episode name: Grounded Vindaloop
Episode number: S18E07
Mean sentiment score: -0.84","Episode name: Cock Magic
Episode number: S18E08
Mean sentiment score: -0.94","Episode name: #REHASH
Episode number: S18E09
Mean sentiment score: -0.46","Episode name: #HappyHolograms
Episode number: S18E10
Mean sentiment score: -0.7","Episode name: Stunning and Brave
Episode number: S19E01
Mean sentiment score: -0.35","Episode name: Where My Country Gone?
Episode number: S19E02
Mean sentiment score: -0.8","Episode name: The City Part of Town
Episode number: S19E03
Mean sentiment score: -0.16","Episode name: You're Not Yelping
Episode number: S19E04
Mean sentiment score: -0.6","Episode name: Safe Space
Episode number: S19E05
Mean sentiment score: -0.16","Episode name: Naughty Ninjas
Episode number: S19E07
Mean sentiment score: -0.43","Episode name: Sponsored Content
Episode number: S19E08
Mean sentiment score: -0.35","Episode name: Truth and Advertising
Episode number: S19E09
Mean sentiment score: -1.05","Episode name: PC Principal Final Justice
Episode number: S19E10
Mean sentiment score: -0.56","Episode name: Member Berries
Episode number: S20E01
Mean sentiment score: -0.42","Episode name: The Damned
Episode number: S20E03
Mean sentiment score: -0.96","Episode name: Wieners Out
Episode number: S20E04
Mean sentiment score: -0.51","Episode name: Douche and a Danish
Episode number: S20E05
Mean sentiment score: -0.66","Episode name: Fort Collins
Episode number: S20E06
Mean sentiment score: -0.42","Episode name: Oh, Jeez
Episode number: S20E07
Mean sentiment score: -0.13","Episode name: Members Only
Episode number: S20E08
Mean sentiment score: -0.05","Episode name: Not Funny
Episode number: S20E09
Mean sentiment score: -0.91","Episode name: The End of Serialization as We Know It
Episode number: S20E10
Mean sentiment score: -0.36","Episode name: White People Renovating Houses
Episode number: S21E01
Mean sentiment score: -0.54","Episode name: Put It Down
Episode number: S21E02
Mean sentiment score: -0.79","Episode name: Holiday Special
Episode number: S21E03
Mean sentiment score: -0.7","Episode name: Franchise Prequel
Episode number: S21E04
Mean sentiment score: -0.09","Episode name: Hummels & Heroin
Episode number: S21E05
Mean sentiment score: -0.76","Episode name: Sons A Witches
Episode number: S21E06
Mean sentiment score: -0.43","Episode name: Doubling Down
Episode number: S21E07
Mean sentiment score: -0.74","Episode name: Moss Piglets
Episode number: S21E08
Mean sentiment score: -0.11","Episode name: SUPER HARD PCness
Episode number: S21E09
Mean sentiment score: -0.26","Episode name: Splatty Tomato
Episode number: S21E10
Mean sentiment score: -0.54","Episode name: Weight Gain 4000
Episode number: S01E02
Mean sentiment score: 0.19","Episode name: Conjoined Fetus Lady
Episode number: S02E05
Mean sentiment score: 0.08","Episode name: Jakovasaurs
Episode number: S03E04
Mean sentiment score: 0.39","Episode name: Mr. Hankey's Christmas Classics
Episode number: S03E15
Mean sentiment score: 0.78","Episode name: Are You There God? It's Me, Jesus
Episode number: S03E16
Mean sentiment score: 0.5","Episode name: Cartman Joins NAMBLA
Episode number: S04E05
Mean sentiment score: 0.03","Episode name: Pip
Episode number: S04E14
Mean sentiment score: 0.08","Episode name: A Very Crappy Christmas
Episode number: S04E17
Mean sentiment score: 0.53","Episode name: Cripple Fight
Episode number: S05E02
Mean sentiment score: 0.39","Episode name: Super Best Friends
Episode number: S05E03
Mean sentiment score: 0.17","Episode name: Proper Condom Use
Episode number: S05E07
Mean sentiment score: 0.02","Episode name: How to Eat with Your Butt
Episode number: S05E10
Mean sentiment score: 0.46","Episode name: Here Comes the Neighborhood
Episode number: S05E12
Mean sentiment score: 0.8","Episode name: Asspen
Episode number: S06E02
Mean sentiment score: 0.72","Episode name: Free Hat
Episode number: S06E09
Mean sentiment score: 0.08","Episode name: Red Sleigh Down
Episode number: S06E17
Mean sentiment score: 0.47","Episode name: Krazy Kripples
Episode number: S07E02
Mean sentiment score: 0.38","Episode name: Red Man's Greed
Episode number: S07E07
Mean sentiment score: 0.6","Episode name: South Park is Gay!
Episode number: S07E08
Mean sentiment score: 0.32","Episode name: Christian Rock Hard
Episode number: S07E09
Mean sentiment score: 0.4","Episode name: Casa Bonita
Episode number: S07E11
Mean sentiment score: 0.27","Episode name: Raisins
Episode number: S07E14
Mean sentiment score: 0","Episode name: Up the Down Steroid
Episode number: S08E02
Mean sentiment score: 0.34","Episode name: AWESOM-O
Episode number: S08E05
Mean sentiment score: 0.3","Episode name: Quest for Ratings
Episode number: S08E11
Mean sentiment score: 0.31","Episode name: Mr. Garrison's Fancy New Vagina
Episode number: S09E01
Mean sentiment score: 0.08","Episode name: Wing
Episode number: S09E03
Mean sentiment score: 0.28","Episode name: Erection Day
Episode number: S09E07
Mean sentiment score: 0.16","Episode name: Free Willzyx
Episode number: S09E13
Mean sentiment score: 0.25","Episode name: Bloody Mary
Episode number: S09E14
Mean sentiment score: 0.08","Episode name: The Return of Chef!
Episode number: S10E01
Mean sentiment score: 0.38","Episode name: Stanley's Cup
Episode number: S10E14
Mean sentiment score: 0.7","Episode name: Guitar Queer-O
Episode number: S11E13
Mean sentiment score: 0.9","Episode name: The List
Episode number: S11E14
Mean sentiment score: 0.14","Episode name: Super Fun Time
Episode number: S12E07
Mean sentiment score: 0.06","Episode name: About Last Night...
Episode number: S12E12
Mean sentiment score: 0.21","Episode name: The Ring
Episode number: S13E01
Mean sentiment score: 0.19","Episode name: Fishsticks
Episode number: S13E05
Mean sentiment score: 0.79","Episode name: You Have 0 Friends
Episode number: S14E04
Mean sentiment score: 0.04","Episode name: Creme Fraiche
Episode number: S14E14
Mean sentiment score: 0.08","Episode name: Funnybot
Episode number: S15E02
Mean sentiment score: 0.4","Episode name: Broadway Bro Down
Episode number: S15E11
Mean sentiment score: 0.21","Episode name: Jewpacabra
Episode number: S16E04
Mean sentiment score: 0.03","Episode name: Cartman Finds Love
Episode number: S16E07
Mean sentiment score: 0.11","Episode name: Sarcastaball
Episode number: S16E08
Mean sentiment score: 0.86","Episode name: A Nightmare on Face Time
Episode number: S16E12
Mean sentiment score: 0.13","Episode name: Obama Wins!
Episode number: S16E14
Mean sentiment score: 0.19","Episode name: Ginger Cow
Episode number: S17E06
Mean sentiment score: 0.75","Episode name: Black Friday
Episode number: S17E07
Mean sentiment score: 0.01","Episode name: The Hobbit
Episode number: S17E10
Mean sentiment score: 0.18","Episode name: Go Fund Yourself
Episode number: S18E01
Mean sentiment score: 0.11","Episode name: Tweek x Craig
Episode number: S19E06
Mean sentiment score: 0.08","Episode name: Skank Hunt
Episode number: S20E02
Mean sentiment score: 0"],"type":"bar","marker":{"autocolorscale":false,"color":"rgba(89,89,89,1)","line":{"width":1.88976377952756,"color":"rgba(89,42,136,1)"}},"showlegend":false,"xaxis":"x","yaxis":"y","hoverinfo":"text","frame":null},{"x":[1,4.62025316455696,8.24050632911392,11.8607594936709,15.4810126582278,19.1012658227848,22.7215189873418,26.3417721518987,29.9620253164557,33.5822784810127,37.2025316455696,40.8227848101266,44.4430379746835,48.0632911392405,51.6835443037975,55.3037974683544,58.9240506329114,62.5443037974684,66.1645569620253,69.7848101265823,73.4050632911392,77.0253164556962,80.6455696202532,84.2658227848101,87.8860759493671,91.5063291139241,95.126582278481,98.746835443038,102.367088607595,105.987341772152,109.607594936709,113.227848101266,116.848101265823,120.46835443038,124.088607594937,127.708860759494,131.329113924051,134.949367088608,138.569620253165,142.189873417722,145.810126582278,149.430379746835,153.050632911392,156.670886075949,160.291139240506,163.911392405063,167.53164556962,171.151898734177,174.772151898734,178.392405063291,182.012658227848,185.632911392405,189.253164556962,192.873417721519,196.493670886076,200.113924050633,203.73417721519,207.354430379747,210.974683544304,214.594936708861,218.215189873418,221.835443037975,225.455696202532,229.075949367089,232.696202531646,236.316455696203,239.936708860759,243.556962025316,247.177215189873,250.79746835443,254.417721518987,258.037974683544,261.658227848101,265.278481012658,268.898734177215,272.518987341772,276.139240506329,279.759493670886,283.379746835443,287],"y":[-0.676331764783419,-0.640076604213663,-0.605243018819805,-0.571851398501541,-0.53992213315857,-0.50947561269059,-0.480532226997299,-0.453112365978396,-0.427236419533578,-0.402924777562544,-0.380201707584465,-0.359117102638274,-0.339640576504922,-0.321720732668401,-0.305306174612701,-0.290345505821813,-0.276787329779728,-0.264580249970436,-0.253672869877928,-0.244013792986195,-0.235668240223333,-0.229652783409412,-0.225990022169457,-0.224398325650298,-0.224596062998767,-0.226301603361693,-0.229233315885907,-0.233109569718241,-0.237648734005523,-0.242569177894585,-0.247921735006141,-0.255837270200308,-0.266265923812237,-0.278621008861882,-0.292315838369197,-0.306763725354136,-0.321377982836655,-0.335571923836708,-0.348758861374248,-0.360352108469231,-0.370355142295464,-0.381736253035186,-0.394534675806752,-0.408201036267907,-0.422185960076395,-0.435940072889959,-0.448914000366344,-0.460558368163293,-0.470323801938551,-0.477660927349862,-0.482254158362576,-0.485021210378926,-0.486370101461478,-0.486587160074608,-0.485958714682696,-0.484771093750118,-0.483310625741252,-0.481863639120476,-0.480716462352167,-0.480155423900704,-0.480176799675132,-0.479813220760633,-0.47898431959351,-0.477719984105189,-0.476050102227095,-0.474004561890654,-0.471613251027291,-0.468906057568433,-0.465912869445504,-0.46266357458993,-0.459187872776813,-0.455493539245639,-0.451564885347977,-0.447385416035237,-0.442938636258828,-0.438208050970159,-0.43317716512064,-0.427829483661681,-0.42214851154469,-0.416117753721078],"text":"","type":"scatter","mode":"lines","name":"fitted values","line":{"width":3.77952755905512,"color":"rgba(51,102,255,1)","dash":"solid"},"hoveron":"points","showlegend":false,"xaxis":"x","yaxis":"y","hoverinfo":"text","frame":null},{"x":[1,4.62025316455696,8.24050632911392,11.8607594936709,15.4810126582278,19.1012658227848,22.7215189873418,26.3417721518987,29.9620253164557,33.5822784810127,37.2025316455696,40.8227848101266,44.4430379746835,48.0632911392405,51.6835443037975,55.3037974683544,58.9240506329114,62.5443037974684,66.1645569620253,69.7848101265823,73.4050632911392,77.0253164556962,80.6455696202532,84.2658227848101,87.8860759493671,91.5063291139241,95.126582278481,98.746835443038,102.367088607595,105.987341772152,109.607594936709,113.227848101266,116.848101265823,120.46835443038,124.088607594937,127.708860759494,131.329113924051,134.949367088608,138.569620253165,142.189873417722,145.810126582278,149.430379746835,153.050632911392,156.670886075949,160.291139240506,163.911392405063,167.53164556962,171.151898734177,174.772151898734,178.392405063291,182.012658227848,185.632911392405,189.253164556962,192.873417721519,196.493670886076,200.113924050633,203.73417721519,207.354430379747,210.974683544304,214.594936708861,218.215189873418,221.835443037975,225.455696202532,229.075949367089,232.696202531646,236.316455696203,239.936708860759,243.556962025316,247.177215189873,250.79746835443,254.417721518987,258.037974683544,261.658227848101,265.278481012658,268.898734177215,272.518987341772,276.139240506329,279.759493670886,283.379746835443,287,287,287,283.379746835443,279.759493670886,276.139240506329,272.518987341772,268.898734177215,265.278481012658,261.658227848101,258.037974683544,254.417721518987,250.79746835443,247.177215189873,243.556962025316,239.936708860759,236.316455696203,232.696202531646,229.075949367089,225.455696202532,221.835443037975,218.215189873418,214.594936708861,210.974683544304,207.354430379747,203.73417721519,200.113924050633,196.493670886076,192.873417721519,189.253164556962,185.632911392405,182.012658227848,178.392405063291,174.772151898734,171.151898734177,167.53164556962,163.911392405063,160.291139240506,156.670886075949,153.050632911392,149.430379746835,145.810126582278,142.189873417722,138.569620253165,134.949367088608,131.329113924051,127.708860759494,124.088607594937,120.46835443038,116.848101265823,113.227848101266,109.607594936709,105.987341772152,102.367088607595,98.746835443038,95.126582278481,91.5063291139241,87.8860759493671,84.2658227848101,80.6455696202532,77.0253164556962,73.4050632911392,69.7848101265823,66.1645569620253,62.5443037974684,58.9240506329114,55.3037974683544,51.6835443037975,48.0632911392405,44.4430379746835,40.8227848101266,37.2025316455696,33.5822784810127,29.9620253164557,26.3417721518987,22.7215189873418,19.1012658227848,15.4810126582278,11.8607594936709,8.24050632911392,4.62025316455696,1,1],"y":[-0.880281755003926,-0.827583210204389,-0.77741500484756,-0.72986831383779,-0.685037603084954,-0.643017057453503,-0.603894413349783,-0.567741702482482,-0.534603281865551,-0.504483093725987,-0.477338019929468,-0.453090485628546,-0.431556075489998,-0.412518017504966,-0.395755524863222,-0.381053033797568,-0.368207266133441,-0.357031427653239,-0.347356832653477,-0.339032754302318,-0.33200561308194,-0.326930242785002,-0.323908412510571,-0.322887268992917,-0.323786550483344,-0.326441016460434,-0.330566919091223,-0.33575544460432,-0.341491443469281,-0.347190801873114,-0.352531533839516,-0.359281175821892,-0.367936667056726,-0.378601165786185,-0.391266828145614,-0.40568499272758,-0.421278646009852,-0.437139772992736,-0.452113051894026,-0.464924592913544,-0.474927626739777,-0.485090443554964,-0.496102524962781,-0.508101699441105,-0.521107227449839,-0.534891062666376,-0.548894157290647,-0.562229111407782,-0.573767707560135,-0.582270726183237,-0.586875782341104,-0.588863919842684,-0.589015976347557,-0.587920763279924,-0.586098127781437,-0.583961581234695,-0.58179956908387,-0.57978202946159,-0.577993921727757,-0.576492796759311,-0.575195760991255,-0.573497183536182,-0.571435497276313,-0.569139920458902,-0.566757630202849,-0.564453912141175,-0.562410535863856,-0.560821556553509,-0.559886252435776,-0.559799886934933,-0.560746188940255,-0.562860401577611,-0.566194221852063,-0.570747602387721,-0.576480081021741,-0.583323520896543,-0.59119408045689,-0.600001469689437,-0.609655117535416,-0.620067743941585,-0.620067743941585,-0.21216776350057,-0.234641905553964,-0.255657497633925,-0.275160249784391,-0.293092581043775,-0.309397191495915,-0.324023229682753,-0.336935548843891,-0.348126676913666,-0.35762955661337,-0.365527262244927,-0.371939486455231,-0.376990558583356,-0.380815966190726,-0.383555211640133,-0.38534257425134,-0.386300047751476,-0.386533141910707,-0.386129257985084,-0.385157838359009,-0.383818051042097,-0.383439002976577,-0.383945248779362,-0.384821682398633,-0.385580606265541,-0.385819301583955,-0.385253556869293,-0.383724226575399,-0.381178500915168,-0.377632534384048,-0.373051128516487,-0.366879896316968,-0.358887624918805,-0.348933843442041,-0.336989083113541,-0.323264692702951,-0.30830037309471,-0.292966826650723,-0.278382062515407,-0.265782657851151,-0.255779624024919,-0.24540467085447,-0.234004074680679,-0.221477319663458,-0.207842457980692,-0.193364848592779,-0.178640851937579,-0.164595180567749,-0.152393364578725,-0.143311936172766,-0.137947553916057,-0.133806024541765,-0.130463694832162,-0.127899712680592,-0.126162190262952,-0.125405575514189,-0.125909382307679,-0.128071631828342,-0.132375324033822,-0.139330867364726,-0.148994831670072,-0.159988907102379,-0.172129072287633,-0.185367393426015,-0.199637977846059,-0.21485682436218,-0.230923447831836,-0.247725077519846,-0.265143719648001,-0.283065395239462,-0.301366461399102,-0.319869557201606,-0.33848302947431,-0.357170040644816,-0.375934167927677,-0.394806663232186,-0.413834483165292,-0.433071032792049,-0.452569998222937,-0.472381774562912,-0.880281755003926],"text":"","type":"scatter","mode":"lines","line":{"width":3.77952755905512,"color":"transparent","dash":"solid"},"fill":"toself","fillcolor":"rgba(153,153,153,0.4)","hoveron":"points","hoverinfo":"x+y","showlegend":false,"xaxis":"x","yaxis":"y","frame":null}],"layout":{"margin":{"t":26.2283105022831,"r":7.30593607305936,"b":40.1826484018265,"l":37.2602739726027},"plot_bgcolor":"rgba(255,255,255,1)","paper_bgcolor":"rgba(255,255,255,1)","font":{"color":"rgba(0,0,0,1)","family":"","size":14.6118721461187},"xaxis":{"domain":[0,1],"type":"linear","autorange":false,"range":[-13.795,301.795],"tickmode":"array","ticktext":["0","100","200","300"],"tickvals":[1.77635683940025e-015,100,200,300],"categoryorder":"array","categoryarray":["0","100","200","300"],"nticks":null,"ticks":"outside","tickcolor":"rgba(51,51,51,1)","ticklen":3.65296803652968,"tickwidth":0.66417600664176,"showticklabels":true,"tickfont":{"color":"rgba(77,77,77,1)","family":"","size":11.689497716895},"tickangle":-0,"showline":true,"linecolor":"rgba(0,0,0,1)","linewidth":0.66417600664176,"showgrid":false,"gridcolor":null,"gridwidth":0,"zeroline":false,"anchor":"y","title":"episode_number","titlefont":{"color":"rgba(0,0,0,1)","family":"","size":14.6118721461187},"hoverformat":".2f"},"yaxis":{"domain":[0,1],"type":"linear","autorange":false,"range":[-2.56483870967742,1.06161290322581],"tickmode":"array","ticktext":["-2","-1","0","1"],"tickvals":[-2,-1,0,1],"categoryorder":"array","categoryarray":["-2","-1","0","1"],"nticks":null,"ticks":"outside","tickcolor":"rgba(51,51,51,1)","ticklen":3.65296803652968,"tickwidth":0.66417600664176,"showticklabels":true,"tickfont":{"color":"rgba(77,77,77,1)","family":"","size":11.689497716895},"tickangle":-0,"showline":true,"linecolor":"rgba(0,0,0,1)","linewidth":0.66417600664176,"showgrid":false,"gridcolor":null,"gridwidth":0,"zeroline":false,"anchor":"x","title":"mean_sentiment_score","titlefont":{"color":"rgba(0,0,0,1)","family":"","size":14.6118721461187},"hoverformat":".2f"},"shapes":[{"type":"rect","fillcolor":null,"line":{"color":null,"width":0,"linetype":[]},"yref":"paper","xref":"paper","x0":0,"x1":1,"y0":0,"y1":1}],"showlegend":false,"legend":{"bgcolor":"rgba(255,255,255,1)","bordercolor":"transparent","borderwidth":1.88976377952756,"font":{"color":"rgba(0,0,0,1)","family":"","size":11.689497716895}},"hovermode":"closest","barmode":"relative"},"config":{"doubleClick":"reset","modeBarButtonsToAdd":[{"name":"Collaborate","icon":{"width":1000,"ascent":500,"descent":-50,"path":"M487 375c7-10 9-23 5-36l-79-259c-3-12-11-23-22-31-11-8-22-12-35-12l-263 0c-15 0-29 5-43 15-13 10-23 23-28 37-5 13-5 25-1 37 0 0 0 3 1 7 1 5 1 8 1 11 0 2 0 4-1 6 0 3-1 5-1 6 1 2 2 4 3 6 1 2 2 4 4 6 2 3 4 5 5 7 5 7 9 16 13 26 4 10 7 19 9 26 0 2 0 5 0 9-1 4-1 6 0 8 0 2 2 5 4 8 3 3 5 5 5 7 4 6 8 15 12 26 4 11 7 19 7 26 1 1 0 4 0 9-1 4-1 7 0 8 1 2 3 5 6 8 4 4 6 6 6 7 4 5 8 13 13 24 4 11 7 20 7 28 1 1 0 4 0 7-1 3-1 6-1 7 0 2 1 4 3 6 1 1 3 4 5 6 2 3 3 5 5 6 1 2 3 5 4 9 2 3 3 7 5 10 1 3 2 6 4 10 2 4 4 7 6 9 2 3 4 5 7 7 3 2 7 3 11 3 3 0 8 0 13-1l0-1c7 2 12 2 14 2l218 0c14 0 25-5 32-16 8-10 10-23 6-37l-79-259c-7-22-13-37-20-43-7-7-19-10-37-10l-248 0c-5 0-9-2-11-5-2-3-2-7 0-12 4-13 18-20 41-20l264 0c5 0 10 2 16 5 5 3 8 6 10 11l85 282c2 5 2 10 2 17 7-3 13-7 17-13z m-304 0c-1-3-1-5 0-7 1-1 3-2 6-2l174 0c2 0 4 1 7 2 2 2 4 4 5 7l6 18c0 3 0 5-1 7-1 1-3 2-6 2l-173 0c-3 0-5-1-8-2-2-2-4-4-4-7z m-24-73c-1-3-1-5 0-7 2-2 3-2 6-2l174 0c2 0 5 0 7 2 3 2 4 4 5 7l6 18c1 2 0 5-1 6-1 2-3 3-5 3l-174 0c-3 0-5-1-7-3-3-1-4-4-5-6z"},"click":"function(gd) { \n // is this being viewed in RStudio?\n if (location.search == '?viewer_pane=1') {\n alert('To learn about plotly for collaboration, visit:\\n https://cpsievert.github.io/plotly_book/plot-ly-for-collaboration.html');\n } else {\n window.open('https://cpsievert.github.io/plotly_book/plot-ly-for-collaboration.html', '_blank');\n }\n }"}],"cloud":false},"source":"A","attrs":{"b59c46b04891":{"x":{},"y":{},"text":{},"type":"bar"},"b59c5dc076bf":{"x":{},"y":{},"text":{}}},"cur_data":"b59c46b04891","visdat":{"b59c46b04891":["function (y) ","x"],"b59c5dc076bf":["function (y) ","x"]},"highlight":{"on":"plotly_click","persistent":false,"dynamic":false,"selectize":false,"opacityDim":0.2,"selected":{"opacity":1}},"base_url":"https://plot.ly"},"evals":["config.modeBarButtonsToAdd.0.click"],"jsHooks":{"render":[{"code":"function(el, x) { var ctConfig = crosstalk.var('plotlyCrosstalkOpts').set({\"on\":\"plotly_click\",\"persistent\":false,\"dynamic\":false,\"selectize\":false,\"opacityDim\":0.2,\"selected\":{\"opacity\":1}}); }","data":null}]}}
Our code created an interactive plot! Each bar represents an episode. You can hover over the bars to see some information: the episode name, episode number, and sentiment score.
It’s just a few lines of code, but the result looks great! That wasn’t too difficult—with the Tidyverse suite of packages, coding in R is almost like writing an English sentence.
You can see that most episodes have a downward-pointing bar, below zero. That’s mostly because South Park characters aren’t afraid to use dirty words. And they do it quite a lot!
You’ll also notice a blue line in the plot; this denotes a trend in sentiment over time. There was a large increase in the score in earlier episodes that peaked roughly around episode 80 and then started to drop. In other words, the language used by South Park changes over time.
Episodes, how popular are you?
Pretty cool, huh? We can do something very similar with episode popularity. I’ll show you a different kind of plot here. Because the ratings can’t fall below zero, it’s better to use points instead of bars.
The data’s been prepared again. The following code produces an interactive plot of South Park episode ratings:
gg<- ggplot(by_episode,(episode_number,rating, group = 1, text = text_pop)) + geom_point(color = "#592a88", alpha = 0.6, size = 3) + geom_vline(xintercept = 100, color = "red", linetype = "dashed") + geom_smooth() ggplotly(gg, tooltip = "text")
Episode number: S01E01
IMDB rating: 8.2","Episode name: Weight Gain 4000
Episode number: S01E02
IMDB rating: 7.9","Episode name: Volcano
Episode number: S01E03
IMDB rating: 7.9","Episode name: Big Gay Al's Big Gay Boat Ride
Episode number: S01E04
IMDB rating: 7.8","Episode name: An Elephant Makes Love to a Pig
Episode number: S01E05
IMDB rating: 7.7","Episode name: Death
Episode number: S01E06
IMDB rating: 8.2","Episode name: Pinkeye
Episode number: S01E07
IMDB rating: 8.5","Episode name: Starvin' Marvin
Episode number: S01E08
IMDB rating: 8.2","Episode name: Mr. Hankey, the Christmas Poo
Episode number: S01E09
IMDB rating: 8.3","Episode name: Damien
Episode number: S01E10
IMDB rating: 8.1","Episode name: Tom's Rhinoplasty
Episode number: S01E11
IMDB rating: 8.1","Episode name: Mecha-Streisand
Episode number: S01E12
IMDB rating: 7.8","Episode name: Cartman's Mom is a Dirty Slut
Episode number: S01E13
IMDB rating: 8.7","Episode name: Terrance and Phillip in Not Without My Anus
Episode number: S02E01
IMDB rating: 6.6","Episode name: Cartman's Mom is Still a Dirty Slut
Episode number: S02E02
IMDB rating: 8.5","Episode name: Chickenlover
Episode number: S02E03
IMDB rating: 8.2","Episode name: Ike's Wee Wee
Episode number: S02E04
IMDB rating: 8.2","Episode name: Conjoined Fetus Lady
Episode number: S02E05
IMDB rating: 7.9","Episode name: The Mexican Staring Frog of Southern Sri Lanka
Episode number: S02E06
IMDB rating: 7.8","Episode name: City on the Edge of Forever
Episode number: S02E07
IMDB rating: 7.6","Episode name: Summer Sucks
Episode number: S02E08
IMDB rating: 7.7","Episode name: Chef's Chocolate Salty Balls
Episode number: S02E09
IMDB rating: 7.8","Episode name: Chickenpox
Episode number: S02E10
IMDB rating: 8.1","Episode name: Roger Ebert Should Lay off the Fatty Foods
Episode number: S02E11
IMDB rating: 7.8","Episode name: Clubhouses
Episode number: S02E12
IMDB rating: 8.1","Episode name: Cow Days
Episode number: S02E13
IMDB rating: 7.8","Episode name: Chef Aid
Episode number: S02E14
IMDB rating: 8","Episode name: Spookyfish
Episode number: S02E15
IMDB rating: 8.6","Episode name: Merry Christmas Charlie Manson!
Episode number: S02E16
IMDB rating: 8.2","Episode name: Gnomes
Episode number: S02E17
IMDB rating: 8.5","Episode name: Prehistoric Ice Man
Episode number: S02E18
IMDB rating: 8.1","Episode name: Rainforest Shmainforest
Episode number: S03E01
IMDB rating: 8.5","Episode name: Spontaneous Combustion
Episode number: S03E02
IMDB rating: 8.3","Episode name: The Succubus
Episode number: S03E03
IMDB rating: 8.1","Episode name: Jakovasaurs
Episode number: S03E04
IMDB rating: 6.7","Episode name: Tweek vs. Craig
Episode number: S03E05
IMDB rating: 7.8","Episode name: Sexual Harassment Panda
Episode number: S03E06
IMDB rating: 8.4","Episode name: Cat Orgy
Episode number: S03E07
IMDB rating: 8.1","Episode name: Two Guys Naked in a Hot Tub
Episode number: S03E08
IMDB rating: 8.2","Episode name: Jewbilee
Episode number: S03E09
IMDB rating: 7.6","Episode name: Korn's Groovy Pirate Ghost Mystery
Episode number: S03E10
IMDB rating: 8","Episode name: Chinpokomon
Episode number: S03E11
IMDB rating: 8.8","Episode name: Hooked on Monkey Fonics
Episode number: S03E12
IMDB rating: 8.1","Episode name: Starvin' Marvin in Space
Episode number: S03E13
IMDB rating: 8.2","Episode name: The Red Badge of Gayness
Episode number: S03E14
IMDB rating: 8.4","Episode name: Mr. Hankey's Christmas Classics
Episode number: S03E15
IMDB rating: 7.4","Episode name: Are You There God? It's Me, Jesus
Episode number: S03E16
IMDB rating: 8","Episode name: World Wide Recorder Concert
Episode number: S03E17
IMDB rating: 8.2","Episode name: The Tooth Fairy Tats 2000
Episode number: S04E01
IMDB rating: 8.3","Episode name: Cartman's Silly Hate Crime 2000
Episode number: S04E02
IMDB rating: 8.7","Episode name: Timmy 2000
Episode number: S04E03
IMDB rating: 8.3","Episode name: Quintuplets 2000
Episode number: S04E04
IMDB rating: 7.5","Episode name: Cartman Joins NAMBLA
Episode number: S04E05
IMDB rating: 9","Episode name: Cherokee Hair Tampons
Episode number: S04E06
IMDB rating: 8.2","Episode name: Chef Goes Nanners
Episode number: S04E07
IMDB rating: 8.3","Episode name: Something You Can Do with Your Finger
Episode number: S04E08
IMDB rating: 8.2","Episode name: Do the Handicapped Go to Hell?
Episode number: S04E09
IMDB rating: 8.4","Episode name: Probably
Episode number: S04E10
IMDB rating: 8.4","Episode name: Fourth Grade
Episode number: S04E11
IMDB rating: 8.2","Episode name: Trapper Keeper
Episode number: S04E12
IMDB rating: 8.2","Episode name: Helen Keller! The Musical
Episode number: S04E13
IMDB rating: 7.9","Episode name: Pip
Episode number: S04E14
IMDB rating: 7","Episode name: Fat Camp
Episode number: S04E15
IMDB rating: 8.6","Episode name: The Wacky Molestation Adventure
Episode number: S04E16
IMDB rating: 8.8","Episode name: A Very Crappy Christmas
Episode number: S04E17
IMDB rating: 7.6","Episode name: It Hits the Fan
Episode number: S05E01
IMDB rating: 8.5","Episode name: Cripple Fight
Episode number: S05E02
IMDB rating: 8.4","Episode name: Super Best Friends
Episode number: S05E03
IMDB rating: 8.4","Episode name: Scott Tenorman Must Die
Episode number: S05E04
IMDB rating: 9.6","Episode name: Terrance and Phillip: Behind the Blow
Episode number: S05E05
IMDB rating: 7.2","Episode name: Cartmanland
Episode number: S05E06
IMDB rating: 8.9","Episode name: Proper Condom Use
Episode number: S05E07
IMDB rating: 8.6","Episode name: Towelie
Episode number: S05E08
IMDB rating: 8.4","Episode name: Osama bin Laden Has Farty Pants
Episode number: S05E09
IMDB rating: 8","Episode name: How to Eat with Your Butt
Episode number: S05E10
IMDB rating: 8.1","Episode name: The Entity
Episode number: S05E11
IMDB rating: 8.3","Episode name: Here Comes the Neighborhood
Episode number: S05E12
IMDB rating: 8.2","Episode name: Kenny Dies
Episode number: S05E13
IMDB rating: 8.9","Episode name: Butters' Very Own Episode
Episode number: S05E14
IMDB rating: 8.9","Episode name: Jared Has Aides
Episode number: S06E01
IMDB rating: 8.2","Episode name: Asspen
Episode number: S06E02
IMDB rating: 8.4","Episode name: Freak Strike
Episode number: S06E03
IMDB rating: 8.1","Episode name: Fun with Veal
Episode number: S06E04
IMDB rating: 8.1","Episode name: The New Terrance and Phillip Movie Trailer
Episode number: S06E05
IMDB rating: 8.2","Episode name: Professor Chaos
Episode number: S06E06
IMDB rating: 8.6","Episode name: The Simpsons Already Did It
Episode number: S06E07
IMDB rating: 8.9","Episode name: Red Hot Catholic Love
Episode number: S06E08
IMDB rating: 8.3","Episode name: Free Hat
Episode number: S06E09
IMDB rating: 8.4","Episode name: Bebe's Boobs Destroy Society
Episode number: S06E10
IMDB rating: 8.3","Episode name: Child Abduction is Not Funny
Episode number: S06E11
IMDB rating: 8.6","Episode name: A Ladder to Heaven
Episode number: S06E12
IMDB rating: 8.8","Episode name: The Return of the Fellowship of the Ring to the Two Towers
Episode number: S06E13
IMDB rating: 9.3","Episode name: The Death Camp of Tolerance
Episode number: S06E14
IMDB rating: 8.8","Episode name: The Biggest Douche in the Universe
Episode number: S06E15
IMDB rating: 8.7","Episode name: My Future Self n' Me
Episode number: S06E16
IMDB rating: 8.6","Episode name: Red Sleigh Down
Episode number: S06E17
IMDB rating: 8.1","Episode name: Cancelled
Episode number: S07E01
IMDB rating: 8.5","Episode name: Krazy Kripples
Episode number: S07E02
IMDB rating: 8.2","Episode name: Toilet Paper
Episode number: S07E03
IMDB rating: 8.4","Episode name: I'm a Little Bit Country
Episode number: S07E04
IMDB rating: 8.2","Episode name: Fat Butt and Pancake Head
Episode number: S07E05
IMDB rating: 8.5","Episode name: Lil' Crime Stoppers
Episode number: S07E06
IMDB rating: 8.6","Episode name: Red Man's Greed
Episode number: S07E07
IMDB rating: 7.7","Episode name: South Park is Gay!
Episode number: S07E08
IMDB rating: 8.3","Episode name: Christian Rock Hard
Episode number: S07E09
IMDB rating: 9","Episode name: Grey Dawn
Episode number: S07E10
IMDB rating: 8.3","Episode name: Casa Bonita
Episode number: S07E11
IMDB rating: 9.2","Episode name: All About Mormons
Episode number: S07E12
IMDB rating: 8.9","Episode name: Butt Out
Episode number: S07E13
IMDB rating: 8.1","Episode name: Raisins
Episode number: S07E14
IMDB rating: 8.5","Episode name: It's Christmas in Canada
Episode number: S07E15
IMDB rating: 7.8","Episode name: Good Times with Weapons
Episode number: S08E01
IMDB rating: 9.1","Episode name: Up the Down Steroid
Episode number: S08E02
IMDB rating: 8.5","Episode name: The Passion of the Jew
Episode number: S08E03
IMDB rating: 8.7","Episode name: You Got F'd in the A
Episode number: S08E04
IMDB rating: 8.2","Episode name: AWESOM-O
Episode number: S08E05
IMDB rating: 9.2","Episode name: The Jeffersons
Episode number: S08E06
IMDB rating: 8.7","Episode name: Goobacks
Episode number: S08E07
IMDB rating: 8.4","Episode name: Douche and Turd
Episode number: S08E08
IMDB rating: 8.5","Episode name: Something Wall-Mart This Way Comes
Episode number: S08E09
IMDB rating: 8.7","Episode name: Pre-School
Episode number: S08E10
IMDB rating: 8.4","Episode name: Quest for Ratings
Episode number: S08E11
IMDB rating: 8.4","Episode name: Stupid Spoiled Whore Video Playset
Episode number: S08E12
IMDB rating: 8.6","Episode name: Cartman's Incredible Gift
Episode number: S08E13
IMDB rating: 8.6","Episode name: Woodland Critter Christmas
Episode number: S08E14
IMDB rating: 9.1","Episode name: Mr. Garrison's Fancy New Vagina
Episode number: S09E01
IMDB rating: 7.7","Episode name: Die Hippie, Die
Episode number: S09E02
IMDB rating: 8.8","Episode name: Wing
Episode number: S09E03
IMDB rating: 7.5","Episode name: Best Friends Forever
Episode number: S09E04
IMDB rating: 8.7","Episode name: The Losing Edge
Episode number: S09E05
IMDB rating: 8.7","Episode name: The Death of Eric Cartman
Episode number: S09E06
IMDB rating: 9.1","Episode name: Erection Day
Episode number: S09E07
IMDB rating: 7.7","Episode name: Two Days Before the Day After Tomorrow
Episode number: S09E08
IMDB rating: 8.6","Episode name: Marjorine
Episode number: S09E09
IMDB rating: 8.8","Episode name: Follow That Egg!
Episode number: S09E10
IMDB rating: 8","Episode name: Ginger Kids
Episode number: S09E11
IMDB rating: 8.8","Episode name: Trapped in the Closet
Episode number: S09E12
IMDB rating: 9.1","Episode name: Free Willzyx
Episode number: S09E13
IMDB rating: 8.2","Episode name: Bloody Mary
Episode number: S09E14
IMDB rating: 7.9","Episode name: The Return of Chef!
Episode number: S10E01
IMDB rating: 8.2","Episode name: Smug Alert!
Episode number: S10E02
IMDB rating: 8.2","Episode name: Cartoon Wars Part I
Episode number: S10E03
IMDB rating: 8.8","Episode name: Cartoon Wars Part II
Episode number: S10E04
IMDB rating: 8.8","Episode name: A Million Little Fibers
Episode number: S10E05
IMDB rating: 6.4","Episode name: ManBearPig
Episode number: S10E06
IMDB rating: 8","Episode name: Tsst
Episode number: S10E07
IMDB rating: 9","Episode name: Make Love, Not Warcraft
Episode number: S10E08
IMDB rating: 9.5","Episode name: Mystery of the Urinal Deuce
Episode number: S10E09
IMDB rating: 8.3","Episode name: Miss Teacher Bangs a Boy
Episode number: S10E10
IMDB rating: 8.5","Episode name: Hell on Earth 2006
Episode number: S10E11
IMDB rating: 8.1","Episode name: Go God Go
Episode number: S10E12
IMDB rating: 8.7","Episode name: Go God Go XII
Episode number: S10E13
IMDB rating: 8.7","Episode name: Stanley's Cup
Episode number: S10E14
IMDB rating: 7.4","Episode name: With Apologies to Jesse Jackson
Episode number: S11E01
IMDB rating: 8.8","Episode name: Cartman Sucks
Episode number: S11E02
IMDB rating: 8.8","Episode name: Lice Capades
Episode number: S11E03
IMDB rating: 8","Episode name: The Snuke
Episode number: S11E04
IMDB rating: 8.3","Episode name: Fantastic Easter Special
Episode number: S11E05
IMDB rating: 8.3","Episode name: D-Yikes!
Episode number: S11E06
IMDB rating: 7.9","Episode name: Night of the Living Homeless
Episode number: S11E07
IMDB rating: 8.8","Episode name: Le Petit Tourette
Episode number: S11E08
IMDB rating: 8.9","Episode name: More Crap
Episode number: S11E09
IMDB rating: 8","Episode name: Imaginationland
Episode number: S11E10
IMDB rating: 9","Episode name: Imaginationland, Episode II
Episode number: S11E11
IMDB rating: 9","Episode name: Imaginationland, Episode III
Episode number: S11E12
IMDB rating: 9","Episode name: Guitar Queer-O
Episode number: S11E13
IMDB rating: 8.4","Episode name: The List
Episode number: S11E14
IMDB rating: 8.5","Episode name: Tonsil Trouble
Episode number: S12E01
IMDB rating: 7.9","Episode name: Britney's New Look
Episode number: S12E02
IMDB rating: 7","Episode name: Major Boobage
Episode number: S12E03
IMDB rating: 8.7","Episode name: Canada on Strike
Episode number: S12E04
IMDB rating: 8","Episode name: Eek, A Penis!
Episode number: S12E05
IMDB rating: 7.7","Episode name: Over Logging
Episode number: S12E06
IMDB rating: 8.6","Episode name: Super Fun Time
Episode number: S12E07
IMDB rating: 8.4","Episode name: The China Probrem
Episode number: S12E08
IMDB rating: 7.9","Episode name: Breast Cancer Show Ever
Episode number: S12E09
IMDB rating: 8.6","Episode name: Pandemic
Episode number: S12E10
IMDB rating: 8.1","Episode name: Pandemic 2: The Startling
Episode number: S12E11
IMDB rating: 7.9","Episode name: About Last Night...
Episode number: S12E12
IMDB rating: 7.8","Episode name: Elementary School Musical
Episode number: S12E13
IMDB rating: 7.8","Episode name: The Ungroundable
Episode number: S12E14
IMDB rating: 7.9","Episode name: The Ring
Episode number: S13E01
IMDB rating: 8.2","Episode name: The Coon
Episode number: S13E02
IMDB rating: 8.4","Episode name: Margaritaville
Episode number: S13E03
IMDB rating: 8.6","Episode name: Eat, Pray, Queef
Episode number: S13E04
IMDB rating: 6.5","Episode name: Fishsticks
Episode number: S13E05
IMDB rating: 8.8","Episode name: Pinewood Derby
Episode number: S13E06
IMDB rating: 7.9","Episode name: Fatbeard
Episode number: S13E07
IMDB rating: 8.2","Episode name: Dead Celebrities
Episode number: S13E08
IMDB rating: 7.8","Episode name: Butters' Bottom Bitch
Episode number: S13E09
IMDB rating: 8.7","Episode name: W.T.F.
Episode number: S13E10
IMDB rating: 8.3","Episode name: Whale Whores
Episode number: S13E11
IMDB rating: 8.3","Episode name: The F Word
Episode number: S13E12
IMDB rating: 8.2","Episode name: Dances with Smurfs
Episode number: S13E13
IMDB rating: 8.2","Episode name: Pee
Episode number: S13E14
IMDB rating: 7.7","Episode name: Sexual Healing
Episode number: S14E01
IMDB rating: 7.6","Episode name: The Tale of Scrotie McBoogerballs
Episode number: S14E02
IMDB rating: 8","Episode name: Medicinal Fried Chicken
Episode number: S14E03
IMDB rating: 8.7","Episode name: You Have 0 Friends
Episode number: S14E04
IMDB rating: 8.8","Episode name: 200
Episode number: S14E05
IMDB rating: 8.8","Episode name: 201
Episode number: S14E06
IMDB rating: 8.7","Episode name: Crippled Summer
Episode number: S14E07
IMDB rating: 6.9","Episode name: Poor and Stupid
Episode number: S14E08
IMDB rating: 7.6","Episode name: It's a Jersey Thing
Episode number: S14E09
IMDB rating: 8","Episode name: Insheeption
Episode number: S14E10
IMDB rating: 8.1","Episode name: Coon 2: Hindsight
Episode number: S14E11
IMDB rating: 8.2","Episode name: Mysterion Rises
Episode number: S14E12
IMDB rating: 8.4","Episode name: Coon vs. Coon & Friends
Episode number: S14E13
IMDB rating: 8.4","Episode name: Creme Fraiche
Episode number: S14E14
IMDB rating: 8.2","Episode name: HUMANCENTiPAD
Episode number: S15E01
IMDB rating: 7.6","Episode name: Funnybot
Episode number: S15E02
IMDB rating: 6.3","Episode name: Royal Pudding
Episode number: S15E03
IMDB rating: 6.8","Episode name: T.M.I.
Episode number: S15E04
IMDB rating: 8","Episode name: Crack Baby Athletic Association
Episode number: S15E05
IMDB rating: 7.5","Episode name: City Sushi
Episode number: S15E06
IMDB rating: 8","Episode name: You're Getting Old
Episode number: S15E07
IMDB rating: 8.6","Episode name: Ass Burgers
Episode number: S15E08
IMDB rating: 8.1","Episode name: The Last of the Meheecans
Episode number: S15E09
IMDB rating: 8.1","Episode name: Bass to Mouth
Episode number: S15E10
IMDB rating: 7.6","Episode name: Broadway Bro Down
Episode number: S15E11
IMDB rating: 7.9","Episode name: 1%
Episode number: S15E12
IMDB rating: 7.8","Episode name: A History Channel Thanksgiving
Episode number: S15E13
IMDB rating: 7.4","Episode name: The Poor Kid
Episode number: S15E14
IMDB rating: 8","Episode name: Reverse Cowgirl
Episode number: S16E01
IMDB rating: 7.8","Episode name: Cash For Gold
Episode number: S16E02
IMDB rating: 7.9","Episode name: Faith Hilling
Episode number: S16E03
IMDB rating: 7.3","Episode name: Jewpacabra
Episode number: S16E04
IMDB rating: 6.7","Episode name: Butterballs
Episode number: S16E05
IMDB rating: 7.6","Episode name: I Should Have Never Gone Ziplining
Episode number: S16E06
IMDB rating: 6.8","Episode name: Cartman Finds Love
Episode number: S16E07
IMDB rating: 8.1","Episode name: Sarcastaball
Episode number: S16E08
IMDB rating: 7.5","Episode name: Raising the Bar
Episode number: S16E09
IMDB rating: 8.2","Episode name: Insecurity
Episode number: S16E10
IMDB rating: 8.3","Episode name: Going Native
Episode number: S16E11
IMDB rating: 6.6","Episode name: A Nightmare on Face Time
Episode number: S16E12
IMDB rating: 8.3","Episode name: A Scause For Applause
Episode number: S16E13
IMDB rating: 7.3","Episode name: Obama Wins!
Episode number: S16E14
IMDB rating: 7.5","Episode name: Let Go, Let Gov
Episode number: S17E01
IMDB rating: 7.5","Episode name: Informative Murder Porn
Episode number: S17E02
IMDB rating: 8.1","Episode name: World War Zimmerman
Episode number: S17E03
IMDB rating: 7.8","Episode name: Goth Kids 3: Dawn of the Posers
Episode number: S17E04
IMDB rating: 6.9","Episode name: Taming Strange
Episode number: S17E05
IMDB rating: 7.3","Episode name: Ginger Cow
Episode number: S17E06
IMDB rating: 7.8","Episode name: Black Friday
Episode number: S17E07
IMDB rating: 8.9","Episode name: A Song of Ass and Fire
Episode number: S17E08
IMDB rating: 8.8","Episode name: Titties and Dragons
Episode number: S17E09
IMDB rating: 8.8","Episode name: The Hobbit
Episode number: S17E10
IMDB rating: 8.5","Episode name: Go Fund Yourself
Episode number: S18E01
IMDB rating: 7.8","Episode name: Gluten Free Ebola
Episode number: S18E02
IMDB rating: 7.8","Episode name: The Cissy
Episode number: S18E03
IMDB rating: 8.6","Episode name: Handicar
Episode number: S18E04
IMDB rating: 7.4","Episode name: The Magic Bush
Episode number: S18E05
IMDB rating: 8","Episode name: Freemium Isn't Free
Episode number: S18E06
IMDB rating: 8.3","Episode name: Grounded Vindaloop
Episode number: S18E07
IMDB rating: 9.1","Episode name: Cock Magic
Episode number: S18E08
IMDB rating: 8.4","Episode name: #REHASH
Episode number: S18E09
IMDB rating: 7.5","Episode name: #HappyHolograms
Episode number: S18E10
IMDB rating: 6.9","Episode name: Stunning and Brave
Episode number: S19E01
IMDB rating: 7.8","Episode name: Where My Country Gone?
Episode number: S19E02
IMDB rating: 8.3","Episode name: The City Part of Town
Episode number: S19E03
IMDB rating: 7.7","Episode name: You're Not Yelping
Episode number: S19E04
IMDB rating: 8.1","Episode name: Safe Space
Episode number: S19E05
IMDB rating: 8.5","Episode name: Tweek x Craig
Episode number: S19E06
IMDB rating: 8","Episode name: Naughty Ninjas
Episode number: S19E07
IMDB rating: 8.4","Episode name: Sponsored Content
Episode number: S19E08
IMDB rating: 9","Episode name: Truth and Advertising
Episode number: S19E09
IMDB rating: 8.2","Episode name: PC Principal Final Justice
Episode number: S19E10
IMDB rating: 8","Episode name: Member Berries
Episode number: S20E01
IMDB rating: 8","Episode name: Skank Hunt
Episode number: S20E02
IMDB rating: 8.2","Episode name: The Damned
Episode number: S20E03
IMDB rating: 8.2","Episode name: Wieners Out
Episode number: S20E04
IMDB rating: 8","Episode name: Douche and a Danish
Episode number: S20E05
IMDB rating: 7.4","Episode name: Fort Collins
Episode number: S20E06
IMDB rating: 7.5","Episode name: Oh, Jeez
Episode number: S20E07
IMDB rating: 7.1","Episode name: Members Only
Episode number: S20E08
IMDB rating: 7.5","Episode name: Not Funny
Episode number: S20E09
IMDB rating: 7.5","Episode name: The End of Serialization as We Know It
Episode number: S20E10
IMDB rating: 7","Episode name: White People Renovating Houses
Episode number: S21E01
IMDB rating: 6.6","Episode name: Put It Down
Episode number: S21E02
IMDB rating: 7.9","Episode name: Holiday Special
Episode number: S21E03
IMDB rating: 7.7","Episode name: Franchise Prequel
Episode number: S21E04
IMDB rating: 7.3","Episode name: Hummels & Heroin
Episode number: S21E05
IMDB rating: 7.4","Episode name: Sons A Witches
Episode number: S21E06
IMDB rating: 7.3","Episode name: Doubling Down
Episode number: S21E07
IMDB rating: 7.4","Episode name: Moss Piglets
Episode number: S21E08
IMDB rating: 7.2","Episode name: SUPER HARD PCness
Episode number: S21E09
IMDB rating: 7.9","Episode name: Splatty Tomato
Episode number: S21E10
IMDB rating: 7.1"],"type":"scatter","mode":"markers","marker":{"autocolorscale":false,"color":"rgba(89,42,136,1)","opacity":0.6,"size":11.3385826771654,"symbol":"circle","line":{"width":1.88976377952756,"color":"rgba(89,42,136,1)"}},"hoveron":"points","showlegend":false,"xaxis":"x","yaxis":"y","hoverinfo":"text","frame":null},{"x":[100,100],"y":[6.135,9.765],"text":"","type":"scatter","mode":"lines","line":{"width":1.88976377952756,"color":"rgba(255,0,0,1)","dash":"dash"},"hoveron":"points","showlegend":false,"xaxis":"x","yaxis":"y","hoverinfo":"text","frame":null},{"x":[1,4.62025316455696,8.24050632911392,11.8607594936709,15.4810126582278,19.1012658227848,22.7215189873418,26.3417721518987,29.9620253164557,33.5822784810127,37.2025316455696,40.8227848101266,44.4430379746835,48.0632911392405,51.6835443037975,55.3037974683544,58.9240506329114,62.5443037974684,66.1645569620253,69.7848101265823,73.4050632911392,77.0253164556962,80.6455696202532,84.2658227848101,87.8860759493671,91.5063291139241,95.126582278481,98.746835443038,102.367088607595,105.987341772152,109.607594936709,113.227848101266,116.848101265823,120.46835443038,124.088607594937,127.708860759494,131.329113924051,134.949367088608,138.569620253165,142.189873417722,145.810126582278,149.430379746835,153.050632911392,156.670886075949,160.291139240506,163.911392405063,167.53164556962,171.151898734177,174.772151898734,178.392405063291,182.012658227848,185.632911392405,189.253164556962,192.873417721519,196.493670886076,200.113924050633,203.73417721519,207.354430379747,210.974683544304,214.594936708861,218.215189873418,221.835443037975,225.455696202532,229.075949367089,232.696202531646,236.316455696203,239.936708860759,243.556962025316,247.177215189873,250.79746835443,254.417721518987,258.037974683544,261.658227848101,265.278481012658,268.898734177215,272.518987341772,276.139240506329,279.759493670886,283.379746835443,287],"y":[7.85379242837228,7.88970304643435,7.92449584342251,7.95820433624379,7.99086204180521,8.02250247701379,8.05315915877655,8.08286560400053,8.11165532959273,8.1395618524602,8.16662073550645,8.19286186347126,8.21823187569073,8.2426615005293,8.26608146635141,8.2884225015215,8.30961533440403,8.32959069336342,8.34827930676413,8.3656119029706,8.38169031648207,8.39800391649985,8.4145676866731,8.43094861232617,8.44671367878342,8.4614298713692,8.47466417540786,8.48598357622377,8.49495505914127,8.50114560948473,8.50422543198321,8.5047427971795,8.50297056684307,8.49904936342089,8.49311980935999,8.48532252710736,8.47579813911003,8.46468726781498,8.45213053566923,8.43826856511979,8.4224878989196,8.40085467885798,8.37390544131599,8.34298080209169,8.30942137698317,8.27456778178851,8.23976063230577,8.20634054433303,8.17564813366837,8.14902401610986,8.12700426228465,8.10644652955963,8.08675288162429,8.06779024128043,8.04942553132986,8.0315256745744,8.01395759381587,7.99658821185605,7.97928445149678,7.96191323553986,7.94440208219947,7.9269292691638,7.90954963814878,7.89229786365274,7.87520862017401,7.8583165822109,7.84165642426175,7.82526282082487,7.8091704463986,7.79341397548125,7.77801126539328,7.7629213689122,7.74812994289138,7.73362596422542,7.71939840980894,7.70543625653657,7.69172848130293,7.67826406100263,7.66503197253029,7.65202119278053],"text":"","type":"scatter","mode":"lines","name":"fitted values","line":{"width":3.77952755905512,"color":"rgba(51,102,255,1)","dash":"solid"},"hoveron":"points","showlegend":false,"xaxis":"x","yaxis":"y","hoverinfo":"text","frame":null},{"x":[1,4.62025316455696,8.24050632911392,11.8607594936709,15.4810126582278,19.1012658227848,22.7215189873418,26.3417721518987,29.9620253164557,33.5822784810127,37.2025316455696,40.8227848101266,44.4430379746835,48.0632911392405,51.6835443037975,55.3037974683544,58.9240506329114,62.5443037974684,66.1645569620253,69.7848101265823,73.4050632911392,77.0253164556962,80.6455696202532,84.2658227848101,87.8860759493671,91.5063291139241,95.126582278481,98.746835443038,102.367088607595,105.987341772152,109.607594936709,113.227848101266,116.848101265823,120.46835443038,124.088607594937,127.708860759494,131.329113924051,134.949367088608,138.569620253165,142.189873417722,145.810126582278,149.430379746835,153.050632911392,156.670886075949,160.291139240506,163.911392405063,167.53164556962,171.151898734177,174.772151898734,178.392405063291,182.012658227848,185.632911392405,189.253164556962,192.873417721519,196.493670886076,200.113924050633,203.73417721519,207.354430379747,210.974683544304,214.594936708861,218.215189873418,221.835443037975,225.455696202532,229.075949367089,232.696202531646,236.316455696203,239.936708860759,243.556962025316,247.177215189873,250.79746835443,254.417721518987,258.037974683544,261.658227848101,265.278481012658,268.898734177215,272.518987341772,276.139240506329,279.759493670886,283.379746835443,287,287,287,283.379746835443,279.759493670886,276.139240506329,272.518987341772,268.898734177215,265.278481012658,261.658227848101,258.037974683544,254.417721518987,250.79746835443,247.177215189873,243.556962025316,239.936708860759,236.316455696203,232.696202531646,229.075949367089,225.455696202532,221.835443037975,218.215189873418,214.594936708861,210.974683544304,207.354430379747,203.73417721519,200.113924050633,196.493670886076,192.873417721519,189.253164556962,185.632911392405,182.012658227848,178.392405063291,174.772151898734,171.151898734177,167.53164556962,163.911392405063,160.291139240506,156.670886075949,153.050632911392,149.430379746835,145.810126582278,142.189873417722,138.569620253165,134.949367088608,131.329113924051,127.708860759494,124.088607594937,120.46835443038,116.848101265823,113.227848101266,109.607594936709,105.987341772152,102.367088607595,98.746835443038,95.126582278481,91.5063291139241,87.8860759493671,84.2658227848101,80.6455696202532,77.0253164556962,73.4050632911392,69.7848101265823,66.1645569620253,62.5443037974684,58.9240506329114,55.3037974683544,51.6835443037975,48.0632911392405,44.4430379746835,40.8227848101266,37.2025316455696,33.5822784810127,29.9620253164557,26.3417721518987,22.7215189873418,19.1012658227848,15.4810126582278,11.8607594936709,8.24050632911392,4.62025316455696,1,1],"y":[7.62444024504174,7.6788422887242,7.73087964927056,7.78050624223387,7.82767228226333,7.87232830005808,7.91443207793786,7.95395905895721,7.99091580777877,8.02535433755777,8.05738598980768,8.08718399341855,8.11486820133434,8.14055531510984,8.16436655114912,8.1864172522775,8.20680894554373,8.22562462094486,8.24292690452867,8.25875822667431,8.2733540190517,8.28861044375431,8.30445345431317,8.32019276396783,8.3351689081972,8.34881798545146,8.3607093617069,8.37055304597691,8.37817862726833,8.38349324844701,8.38658636892533,8.38841484060104,8.38863662194436,8.38661656920733,8.38184436618197,8.37408050828994,8.36345473968074,8.35046903257537,8.33590346830609,8.32067146399872,8.30489079779853,8.28462761149483,8.25968720607638,8.2306374026624,8.19817935816575,8.16329233861049,8.12732783809221,8.09200659943433,8.05932017708991,8.03138495305199,8.00935190124693,7.98967009768669,7.97132235137743,7.95383542757947,7.93681364541213,7.91998090398818,7.90320174545753,7.88647397949612,7.86989097875125,7.85357693810949,7.83754840590318,7.82157686692834,7.80558356573022,7.78949147479245,7.77320337093,7.75660166700862,7.73955023884229,7.72189914646847,7.70349257634588,7.68417922978248,7.66380375049085,7.64218184709824,7.61922339784806,7.59489888338672,7.56922423285324,7.54224649699469,7.51403038729301,7.48464786685068,7.45417121482015,7.42266900944999,7.42266900944999,7.88137337611107,7.87589273024043,7.87188025515457,7.86942657531285,7.86862601607846,7.86957258676465,7.87235304506411,7.87703648793469,7.88366089072617,7.89221878029571,7.90264872118002,7.91484831645132,7.92862649518127,7.9437626096812,7.96003149741319,7.97721386941801,7.99510425251304,8.01351571056734,8.03228167139926,8.05125575849576,8.07024953297023,8.08867792424232,8.10670244421598,8.12471344217421,8.14307044516062,8.1620374172476,8.18174505498138,8.20218341187115,8.22322296143257,8.24465662332237,8.26666307916774,8.29197609024683,8.32067448923173,8.35219342651932,8.38584322496652,8.4206633958006,8.45532420152098,8.4881236765556,8.51708174622113,8.54008500004067,8.55586566624086,8.56835760303238,8.57890550305459,8.58814153853931,8.59656454592479,8.60439525253801,8.61148215763444,8.61730451174177,8.62107075375797,8.62186449504108,8.61879797052245,8.61173149101421,8.60141410647063,8.58861898910882,8.57404175728693,8.55825844936964,8.54170446068452,8.52468191903303,8.50739738924539,8.49002661391244,8.47246557926689,8.45363170899959,8.43355676578199,8.41242172326432,8.39042775076551,8.36779638155369,8.34476768594875,8.32159555004713,8.29853973352398,8.27585548120522,8.25376936736262,8.2323948514067,8.21177214904384,8.19188623961525,8.17267665396949,8.15405180134709,8.13590243025371,8.11811203757445,8.10056380414449,8.08314461170282,7.62444024504174],"text":"","type":"scatter","mode":"lines","line":{"width":3.77952755905512,"color":"transparent","dash":"solid"},"fill":"toself","fillcolor":"rgba(153,153,153,0.4)","hoveron":"points","hoverinfo":"x+y","showlegend":false,"xaxis":"x","yaxis":"y","frame":null}],"layout":{"margin":{"t":26.2283105022831,"r":7.30593607305936,"b":40.1826484018265,"l":31.4155251141553},"plot_bgcolor":"rgba(255,255,255,1)","paper_bgcolor":"rgba(255,255,255,1)","font":{"color":"rgba(0,0,0,1)","family":"","size":14.6118721461187},"xaxis":{"domain":[0,1],"type":"linear","autorange":false,"range":[-13.3,301.3],"tickmode":"array","ticktext":["0","100","200","300"],"tickvals":[0,100,200,300],"categoryorder":"array","categoryarray":["0","100","200","300"],"nticks":null,"ticks":"outside","tickcolor":"rgba(51,51,51,1)","ticklen":3.65296803652968,"tickwidth":0.66417600664176,"showticklabels":true,"tickfont":{"color":"rgba(77,77,77,1)","family":"","size":11.689497716895},"tickangle":-0,"showline":true,"linecolor":"rgba(0,0,0,1)","linewidth":0.66417600664176,"showgrid":false,"gridcolor":null,"gridwidth":0,"zeroline":false,"anchor":"y","title":"episode_number","titlefont":{"color":"rgba(0,0,0,1)","family":"","size":14.6118721461187},"hoverformat":".2f"},"yaxis":{"domain":[0,1],"type":"linear","autorange":false,"range":[6.135,9.765],"tickmode":"array","ticktext":["7","8","9"],"tickvals":[7,8,9],"categoryorder":"array","categoryarray":["7","8","9"],"nticks":null,"ticks":"outside","tickcolor":"rgba(51,51,51,1)","ticklen":3.65296803652968,"tickwidth":0.66417600664176,"showticklabels":true,"tickfont":{"color":"rgba(77,77,77,1)","family":"","size":11.689497716895},"tickangle":-0,"showline":true,"linecolor":"rgba(0,0,0,1)","linewidth":0.66417600664176,"showgrid":false,"gridcolor":null,"gridwidth":0,"zeroline":false,"anchor":"x","title":"rating","titlefont":{"color":"rgba(0,0,0,1)","family":"","size":14.6118721461187},"hoverformat":".2f"},"shapes":[{"type":"rect","fillcolor":null,"line":{"color":null,"width":0,"linetype":[]},"yref":"paper","xref":"paper","x0":0,"x1":1,"y0":0,"y1":1}],"showlegend":false,"legend":{"bgcolor":"rgba(255,255,255,1)","bordercolor":"transparent","borderwidth":1.88976377952756,"font":{"color":"rgba(0,0,0,1)","family":"","size":11.689497716895}},"hovermode":"closest","barmode":"relative"},"config":{"doubleClick":"reset","modeBarButtonsToAdd":[{"name":"Collaborate","icon":{"width":1000,"ascent":500,"descent":-50,"path":"M487 375c7-10 9-23 5-36l-79-259c-3-12-11-23-22-31-11-8-22-12-35-12l-263 0c-15 0-29 5-43 15-13 10-23 23-28 37-5 13-5 25-1 37 0 0 0 3 1 7 1 5 1 8 1 11 0 2 0 4-1 6 0 3-1 5-1 6 1 2 2 4 3 6 1 2 2 4 4 6 2 3 4 5 5 7 5 7 9 16 13 26 4 10 7 19 9 26 0 2 0 5 0 9-1 4-1 6 0 8 0 2 2 5 4 8 3 3 5 5 5 7 4 6 8 15 12 26 4 11 7 19 7 26 1 1 0 4 0 9-1 4-1 7 0 8 1 2 3 5 6 8 4 4 6 6 6 7 4 5 8 13 13 24 4 11 7 20 7 28 1 1 0 4 0 7-1 3-1 6-1 7 0 2 1 4 3 6 1 1 3 4 5 6 2 3 3 5 5 6 1 2 3 5 4 9 2 3 3 7 5 10 1 3 2 6 4 10 2 4 4 7 6 9 2 3 4 5 7 7 3 2 7 3 11 3 3 0 8 0 13-1l0-1c7 2 12 2 14 2l218 0c14 0 25-5 32-16 8-10 10-23 6-37l-79-259c-7-22-13-37-20-43-7-7-19-10-37-10l-248 0c-5 0-9-2-11-5-2-3-2-7 0-12 4-13 18-20 41-20l264 0c5 0 10 2 16 5 5 3 8 6 10 11l85 282c2 5 2 10 2 17 7-3 13-7 17-13z m-304 0c-1-3-1-5 0-7 1-1 3-2 6-2l174 0c2 0 4 1 7 2 2 2 4 4 5 7l6 18c0 3 0 5-1 7-1 1-3 2-6 2l-173 0c-3 0-5-1-8-2-2-2-4-4-4-7z m-24-73c-1-3-1-5 0-7 2-2 3-2 6-2l174 0c2 0 5 0 7 2 3 2 4 4 5 7l6 18c1 2 0 5-1 6-1 2-3 3-5 3l-174 0c-3 0-5-1-7-3-3-1-4-4-5-6z"},"click":"function(gd) { \n // is this being viewed in RStudio?\n if (location.search == '?viewer_pane=1') {\n alert('To learn about plotly for collaboration, visit:\\n https://cpsievert.github.io/plotly_book/plot-ly-for-collaboration.html');\n } else {\n window.open('https://cpsievert.github.io/plotly_book/plot-ly-for-collaboration.html', '_blank');\n }\n }"}],"cloud":false},"source":"A","attrs":{"b59c1ae62dec":{"x":{},"y":{},"text":{},"type":"scatter"},"b59c7c4246a8":{"xintercept":{}},"b59c698f3e02":{"x":{},"y":{},"text":{}}},"cur_data":"b59c1ae62dec","visdat":{"b59c1ae62dec":["function (y) ","x"],"b59c7c4246a8":["function (y) ","x"],"b59c698f3e02":["function (y) ","x"]},"highlight":{"on":"plotly_click","persistent":false,"dynamic":false,"selectize":false,"opacityDim":0.2,"selected":{"opacity":1}},"base_url":"https://plot.ly"},"evals":["config.modeBarButtonsToAdd.0.click"],"jsHooks":{"render":[{"code":"function(el, x) { var ctConfig = crosstalk.var('plotlyCrosstalkOpts').set({\"on\":\"plotly_click\",\"persistent\":false,\"dynamic\":false,\"selectize\":false,\"opacityDim\":0.2,\"selected\":{\"opacity\":1}}); }","data":null}]}}
Each point represents an episode. If you hover over one of these points, you can see the episode name along with its rating. Can you find the best and the worst episodes we talked about earlier? Give it a try!
I’ve also included a trend line; this helps us determine how the popularity changes over time. Do you see any pattern here? Take a look at the trend line after the vertical red line. Up to that point, the popularity increased. After that, it consistently fell.
The funny thing is that the creators themselves made a joke that a TV show shouldn’t go past 100 episodes. For South Park, popularity began to decline after its 97th episode, Cancelled. It looks like the creators were right even about their own show! Numbers don’t lie.
Conclusion
In this article, you learned that sentiment analysis scores words using a subjective dictionary or scale. You also saw how to use such information to get an overall feel of a show like South Park based on character dialog. We put all this awesome data together to make an interactive plot with just a few lines of R code.
In my next article in this series, I’ll focus on the main South Park characters; you’ll learn how their individual sentiments evolve as we take a look at some interesting stats. Stay tuned to see how they differ from each other!
And remember: once you have an idea, nothing is impossible. Answering data questions with R is easy. Be curious, and do what you like! R is a very valuable data science skill nowadays. I personally recommend learning to use the Tidyverse. I use it in every analysis and can’t really imagine a woRld without it!
If you already know R and want to explore the data I showed here on your own, check out my GitHub repository. The page comes with instructions to help you get started.
Good luck, and have fun!
Patrik Drhlik
Patrik is a freelance data scientist from Liberec, Czech Republic. He’s doing his PhD at the Technical University of Liberec, where he also teaches software engineering courses. He is highly passionate about the R programming language and data in general. He never leaves home without his Rubik’s cube and loves hitchhiking, athletics, mountains, kangaroos, and beer.