Advertisement
Guest User

Untitled

a guest
Jan 8th, 2020
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. setwd('C:\\Users\\Student\\Downloads\\Sztuczna Inteligencja')
  2. movie_body_counts <- read.csv("filmdeathcounts.csv", stringsAsFactors=FALSE)
  3.  
  4. library (dplyr)
  5. library (ggplot2)
  6.  
  7. head(movie_body_counts)
  8. str(movie_body_counts)
  9.  
  10. movie_body_counts$body_per_min <- movie_body_counts$Body_Cou nt/movie_body_counts$Length_Minutes
  11. ggplot(movie_body_counts, aes(x=Body_Count)) + geom_histogram(bins=20, color="grey", fill="lightblue")
  12.  
  13. movie_body_counts %>%
  14.   top_n(n = 10, Body_Count) %>%
  15.   arrange(desc(Body_Count))
  16.  
  17. movie_body_counts %>%
  18.   top_n(n = 10, Length_Minutes) %>%
  19.   arrange(desc(Length_Minutes))
  20.  
  21. ggplot(movie_body_counts, aes(x=IMDB_Rating)) + geom_histogram(bins=10, color="grey", fill="lightblue")
  22. #new
  23.  
  24. set.seed(900)
  25. imdb_simulation <- rnorm(n=nrow(movie_body_counts), mean=imdb_mean, sd=imdb_mean)
  26. movie_body_counts$imdb_simulation <- imdb_simulation
  27. ggplot(movie_body_counts, aes(x=imdb_simulation)) + geom_histogram(bins=10, color="grey", fill="lightblue")
  28. ggplot(movie_body_counts, aes(sample=imdb_simulation)) + stat_qq()
  29.  
  30. ggplot(movie_body_counts, aes(sample=IMDB_Rating)) + stat_qq()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement