Skip to content

Instantly share code, notes, and snippets.

@sriyoda
Last active February 1, 2016 20:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sriyoda/e5247fbb40fada999820 to your computer and use it in GitHub Desktop.
Save sriyoda/e5247fbb40fada999820 to your computer and use it in GitHub Desktop.
top_movies_studio <- group_by(topmovies, studio) %>% summarise(total=sum(domestic))
top_movies_scount <- group_by(topmovies, studio) %>% count(studio)
top_movies_m <- left_join(top_movies_studio, top_movies_scount, by="studio")
ggplot(data=top_movies_m) +
geom_point(aes(x=n,y=total), color = "dark green") +
geom_smooth(aes(x=n,y=total), method = "lm") +
ggtitle("Total Studio Revenue vs Number of movies produced") +
xlab("number of movies produced") +
ylab("total revenue from movies produced (dollars)") +
theme_few()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment