diff --git a/DESCRIPTION b/DESCRIPTION index c222851..7b5c4b4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -4,7 +4,7 @@ Description: Datasets and code published by the data journalism website 'FiveThirtyEight' available at . Note that while we received guidance from editors at 'FiveThirtyEight', this package is not officially published by 'FiveThirtyEight'. -Version: 0.3.0.9000 +Version: 0.4.0 Authors@R: c( person("Albert Y.", "Kim", email = "albert.ys.kim@gmail.com", role = c("aut", "cre")), person("Chester", "Ismay", email = "chester.ismay@gmail.com", role = "aut"), diff --git a/NEWS.md b/NEWS.md index c36ca12..dec7f40 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,7 @@ -# fivethirtyeight 0.3.0.9000 +# fivethirtyeight 0.4.0 -* Added new and missing data sets: +* Package website now at +* Added new data sets: + By Meredith Manley: `ahca_polls`, `bachelorette`, `candy_rankings`, `chess_transfers`, `generic_polllist`, `generic_topline`, `mlb_elo`, `ratings`, `spi_global_rankings`, `spi_matches`, `tweets` @@ -10,9 +11,20 @@ `tv_hurricanes`, `tv_hurricanes_by_network`, `tv_states`, `sandy_311`, `senators`, `trump_approval_poll`, `trump_approval_trend`, `trumpworld_issues`, `trumpworld_polls`, `twitter_presidents`, `undefeated` -* Package website now at +* Note for now `mayweather_mcgregor_tweets`, `mlb_elo`, `nba_carmelo`, +`nfl_elo`, `senators`, only include the first 10 rows of the data because of R +package file size restrictions (< 5MB tarballs); code to download/process the +entire dataset are included in help files. We hope to include full versions of +these datasets in v0.5.0 of package using the `drat` package. * Converted all ordinal categorical variables to `factor(..., ordered = TRUE)`. Ex: `bechdel$clean_test` +* Vignette notes: + + Added a vignette that has a link to all user-contributed vignettes, which + areonly available on development version of package and on GitHub due to + CRAN package size restrictions. + + For all datasets that have a user contributed vignette, add a link to it + in the corresponding help/roxygen code file. +* Added `CITATION` # fivethirtyeight 0.3.0 diff --git a/R/data_albert.R b/R/data_albert.R index b05d3b4..9bd6118 100755 --- a/R/data_albert.R +++ b/R/data_albert.R @@ -139,7 +139,7 @@ #' \item{wine_servings}{Servings of wine in average serving sizes per person} #' \item{total_litres_of_pure_alcohol}{Total litres of pure alcohol per person} #' } -#' @source World Health Organisation, Global Information System on Alcohol and Health (GISAH), 2010. +#' @source World Health Organization, Global Information System on Alcohol and Health (GISAH), 2010. #' @examples #' # To convert data frame to tidy data (long) format, run: #' library(tidyverse) @@ -159,6 +159,8 @@ #' The raw data behind the story #' "'Straight Outta Compton' Is The Rare Biopic Not About White Dudes" #' \url{https://fivethirtyeight.com/features/straight-outta-compton-is-the-rare-biopic-not-about-white-dudes/}. +#' An analysis using this data was contributed by Pradeep Adhokshaja as a package vignette at +#' \url{http://fivethirtyeight-r.netlify.com/articles/biopics.html}. #' #' @format A data frame with 761 rows representing movies and 14 variables: #' \describe{ @@ -187,6 +189,8 @@ #' The raw data behind the story #' "A Statistical Analysis of the Work of Bob Ross" #' \url{https://fivethirtyeight.com/features/a-statistical-analysis-of-the-work-of-bob-ross/}. +#' An analysis using this data was contributed by Jonathan Bouchet as a package vignette at +#' \url{http://fivethirtyeight-r.netlify.com/articles/bob_ross.html}. #' #' @format A data frame with 403 rows representing episodes and 71 variables: #' \describe{ @@ -335,7 +339,7 @@ #' \item{employed_fulltime_yearround}{Employed at least 50 weeks (WKW == 1) and at least 35 hours (WKHP >= 35)} #' \item{unemployed}{Number unemployed (ESR == 3)} #' \item{unemployment_rate}{Unemployed / (Unemployed + Employed)} -#' \item{p25th}{25th percentile of earnigns} +#' \item{p25th}{25th percentile of earnings} #' \item{median}{Median earnings of full-time, year-round workers} #' \item{p75th}{75th percentile of earnings} #' } @@ -362,7 +366,7 @@ #' \item{grad_employed_fulltime_yearround}{Employed at least 50 weeks (WKW == 1) and at least 35 hours (WKHP >= 35)} #' \item{grad_unemployed}{Number unemployed (ESR == 3)} #' \item{grad_unemployment_rate}{Unemployed / (Unemployed + Employed)} -#' \item{grad_p25th}{25th percentile of earnigns} +#' \item{grad_p25th}{25th percentile of earnings} #' \item{grad_median}{Median earnings of full-time, year-round workers} #' \item{grad_p75th}{75th percentile of earnings} #' \item{nongrad_total}{Total number of people with major} @@ -370,7 +374,7 @@ #' \item{nongrad_employed_fulltime_yearround}{Employed at least 50 weeks (WKW == 1) and at least 35 hours (WKHP >= 35)} #' \item{nongrad_unemployed}{Number unemployed (ESR == 3)} #' \item{nongrad_unemployment_rate}{Unemployed / (Unemployed + Employed)} -#' \item{nongrad_p25th}{25th percentile of earnigns} +#' \item{nongrad_p25th}{25th percentile of earnings} #' \item{nongrad_median}{Median earnings of full-time, year-round workers} #' \item{nongrad_p75th}{75th percentile of earnings} #' \item{grad_share}{grad_total / (grad_total + nongrad_total)} @@ -405,7 +409,7 @@ #' \item{employed_fulltime_yearround}{Employed at least 50 weeks (WKW == 1) and at least 35 hours (WKHP >= 35)} #' \item{unemployed}{Number unemployed (ESR == 3)} #' \item{unemployment_rate}{Unemployed / (Unemployed + Employed)} -#' \item{p25th}{25th percentile of earnigns} +#' \item{p25th}{25th percentile of earnings} #' \item{median}{Median earnings of full-time, year-round workers} #' \item{p75th}{75th percentile of earnings} #' \item{college_jobs}{Number with job requiring a college degree} @@ -424,6 +428,8 @@ #' The raw data behind the story #' "Comic Books Are Still Made By Men, For Men And About Men" #' \url{https://fivethirtyeight.com/features/women-in-comic-books/}. +#' An analysis using this data was contributed by Jonathan Bouchet as a package vignette at +#' \url{http://fivethirtyeight-r.netlify.com/articles/comics_gender.html}. #' #' @format A data frame with 23272 rows representing characters and 16 variables: #' \describe{ @@ -476,7 +482,7 @@ #' \item{care_data}{How much, if at all, do you care about the debate over the use of the word "data" as a singular or plural noun?} #' \item{care_proper_grammar}{In your opinion, how important or unimportant is proper use of grammar?} #' } -#' @source See \url{https://github.com/fivethirtyeight/data/tree/master/comma-survey-data}. +#' @source See \url{https://github.com/fivethirtyeight/data/tree/master/comma-survey}. "comma_survey" @@ -537,9 +543,9 @@ #' \item{google_knowledge_occupation}{Their occupation or office, according to Google's Knowledge Graph or, if they're not in there, how Stewart introduced them on the program.} #' \item{show}{Air date of episode. Not unique, as some shows had more than one guest} #' \item{group}{A larger group designation for the occupation. For instance, us senators, us presidents, and former presidents are all under "politicians"} -#' \item{raw_guest_list}{The person or list of people who appeared on the show, according to Wikipedia. The GoogleKnowlege_Occupation only refers to one of them in a given row.} +#' \item{raw_guest_list}{The person or list of people who appeared on the show, according to Wikipedia. The GoogleKnowledge_Occupation only refers to one of them in a given row.} #' } -#' @source Google Knowlege Graph, The Daily Show clip library, Wikipedia. +#' @source Google Knowledge Graph, The Daily Show clip library, Wikipedia. "daily_show_guests" diff --git a/R/data_chester.R b/R/data_chester.R index ed364f6..0e53391 100644 --- a/R/data_chester.R +++ b/R/data_chester.R @@ -196,7 +196,7 @@ #' \item{gamenum}{Order of All-Star Game for the season (in years w/ multiple ASGs; set to 0 when only 1 per year)} #' \item{gameid}{Game ID at Baseball-Reference.com} #' \item{lgid}{League of All-Star team} -#' \item{startingpos}{Postion (according to baseball convention; 1=pitcher, 2=catcher, etc.) if starter} +#' \item{startingpos}{Position (according to baseball convention; 1=pitcher, 2=catcher, etc.) if starter} #' \item{off600}{Estimate of offensive talent, in runs above league average per 600 plate appearances} #' \item{def600}{Estimate of fielding talent, in runs above league average per 600 plate appearances} #' \item{pitch200}{Estimate of pitching talent, in runs above league average per 200 innings pitched} @@ -257,6 +257,8 @@ #' The raw data behind the story #' "Projecting The Top 50 Players In The 2015 NBA Draft Class" #' \url{https://fivethirtyeight.com/features/projecting-the-top-50-players-in-the-2015-nba-draft-class/}. +#' An analysis using this data was contributed by G. Elliott Morris as a package vignette at +#' \url{http://fivethirtyeight-r.netlify.com/articles/nba.html}. #' #' @format A data frame with 1090 rows representing National Basketball Association players/prospects and 9 variables: #' \describe{ @@ -333,7 +335,7 @@ #' \item{name}{first initial.last name} #' \item{team}{team at time of suspension} #' \item{games}{number of games suspended (one regular season = 16 games)} -#' \item{category}{personal conduct, substance abuse, peformance enhancing drugs or in-game violence} +#' \item{category}{personal conduct, substance abuse, performance enhancing drugs or in-game violence} #' \item{description}{description of suspension} #' \item{year}{year of suspension} #' \item{source}{news source} diff --git a/R/data_jen.R b/R/data_jen.R index 94381a7..6568a02 100644 --- a/R/data_jen.R +++ b/R/data_jen.R @@ -215,6 +215,9 @@ #' The raw data behind the story #' "A Complete Catalog Of Every Time Someone Cursed Or Bled Out In A Quentin Tarantino Movie" #' \url{https://fivethirtyeight.com/features/complete-catalog-curses-deaths-quentin-tarantino-films/}. +#' An analysis using this data was contributed by Olivia Barrows, Jojo Miller, and Jayla Nakayama +#' as a package vignette at +#' \url{http://fivethirtyeight-r.netlify.com/articles/tarantino_swears.html}. #' #' @format A data frame with 1894 rows representing curse/death instances and 4 variables: #' \describe{ @@ -303,7 +306,9 @@ #' The raw data behind the story #' "The World's Favorite Donald Trump Tweets" #' \url{https://fivethirtyeight.com/features/the-worlds-favorite-donald-trump-tweets/}. -#' Tweets posted on twitter by Donald Trump (@@realDonaldTrump) +#' Tweets posted on twitter by Donald Trump (@@realDonaldTrump). +#' An analysis using this data was contributed by Adam Spannbauer as a package vignette at +#' \url{http://fivethirtyeight-r.netlify.com/articles/trump_twitter.html}. #' #' @format A data frame with 448 rows representing tweets and 3 variables: #' \describe{ @@ -461,7 +466,7 @@ #' \item{mehs}{Mehs} #' \item{league_average_gpct}{League-average goose percentage} #' \item{ppf}{Pitcher park factor} -#' \item{replacement_gpct}{Replacement-level goose pecentage} +#' \item{replacement_gpct}{Replacement-level goose percentage} #' \item{gwar}{Goose Wins Above Replacement} #' \item{key_retro}{Retrosheet unique player identifier} #' } diff --git a/R/data_maggie.R b/R/data_maggie.R index 53541d2..6a1d533 100644 --- a/R/data_maggie.R +++ b/R/data_maggie.R @@ -58,7 +58,10 @@ #' And our "2017 NFL Predictions" #' \url{https://projects.fivethirtyeight.com/2017-nfl-predictions/} #' -#' @format a data frame with 16,007 rows representing games and 14 variables: +#' @format Because of R package size restrictions, only a preview of the +#' first 10 rows of this dataset is included; to obtain the entire dataset +#' (1920 to 2018 games) see Examples below. A data frame with 10 rows +#' representing games and 14 variables: #' \describe{ #' \item{date}{Date} #' \item{season}{Season year, 1920-2018} @@ -76,6 +79,15 @@ #' \item{score2}{Points scored by Team 2} #' } #' @source See \url{https://projects.fivethirtyeight.com/nfl-api/nfl_elo.csv} +#' # To obtain the entire dataset, run the following code: +#' library(tidyverse) +#' library(janitor) +#' nfl_elo <- read_csv("https://projects.fivethirtyeight.com/nfl-api/nfl_elo.csv") %>% +#' clean_names() %>% +#' mutate( +#' team1 = as.factor(team1), +#' team2 = as.factor(team2), +#' neutral = ifelse(neutral == 1, TRUE, FALSE)) "nfl_elo" @@ -118,29 +130,29 @@ #' \describe{ #' \item{team}{NFL team} #' \item{total_respondents}{Total number of poll respondents who ranked the given team in their top 3 favorites} -#' \item{asian_dem}{Number of asian, democrat poll respondents who ranked the given team in their top 3 favorites} -#' \item{black_dem}{Number of black, democrat poll respondents who ranked the given team in their top 3 favorites} -#' \item{hispanic_dem}{Number of hispanic, democrat poll respondents who ranked the given team in their top 3 favorites} -#' \item{other_dem}{Number of democrat poll respondents who identified their race as "other" (not asian, black, hispanic, or white) and ranked the given team in their top 3 favorites} -#' \item{white_dem}{Number of white, democrat poll respondents who ranked the given team in their top 3 favorites} +#' \item{asian_dem}{Number of Asian, democrat poll respondents who ranked the given team in their top 3 favorites} +#' \item{black_dem}{Number of Black, democrat poll respondents who ranked the given team in their top 3 favorites} +#' \item{hispanic_dem}{Number of Hispanic, democrat poll respondents who ranked the given team in their top 3 favorites} +#' \item{other_dem}{Number of democrat poll respondents who identified their race as "other" (not Asian, Black, Hispanic, or White) and ranked the given team in their top 3 favorites} +#' \item{white_dem}{Number of White, democrat poll respondents who ranked the given team in their top 3 favorites} #' \item{total_dem}{Total number of democrat poll respondents who ranked the given team in their top 3 favorites} -#' \item{asian_ind}{Number of asian, independent poll respondents who ranked the given team in their top 3 favorites} -#' \item{black_ind}{Number of black, independent poll respondents who ranked the given team in their top 3 favorites} -#' \item{hispanic_ind}{Number of hispanic, independent poll respondents who ranked the given team in their top 3 favorites} -#' \item{other_ind}{Number of independent poll respondents who identified their race as "other" (not asian, black, hispanic, or white) and ranked the given team in their top 3 favorites} -#' \item{white_ind}{Number of white, independent poll respondents who ranked the given team in their top 3 favorites} +#' \item{asian_ind}{Number of Asian, independent poll respondents who ranked the given team in their top 3 favorites} +#' \item{black_ind}{Number of Black, independent poll respondents who ranked the given team in their top 3 favorites} +#' \item{hispanic_ind}{Number of Hispanic, independent poll respondents who ranked the given team in their top 3 favorites} +#' \item{other_ind}{Number of independent poll respondents who identified their race as "other" (not Asian, Black, Hispanic, or White) and ranked the given team in their top 3 favorites} +#' \item{white_ind}{Number of White, independent poll respondents who ranked the given team in their top 3 favorites} #' \item{total_ind}{Total number of independent poll respondents who ranked the given team in their top 3 favorites} -#' \item{asian_gop}{Number of asian, republican poll respondents who ranked the given team in their top 3 favorites} -#' \item{black_gop}{Number of black, republican poll respondents who ranked the given team in their top 3 favorites} -#' \item{hispanic_gop}{Number of hispanic, republican poll respondents who ranked the given team in their top 3 favorites} -#' \item{other_gop}{Number of republican poll respondents who identified their race as "other" (not asian, black, hispanic, or white) and ranked the given team in their top 3 favorites} -#' \item{white_gop}{Number of white, republican poll respondents who ranked the given team in their top 3 favorites} +#' \item{asian_gop}{Number of Asian, republican poll respondents who ranked the given team in their top 3 favorites} +#' \item{black_gop}{Number of Black, republican poll respondents who ranked the given team in their top 3 favorites} +#' \item{hispanic_gop}{Number of Hispanic, republican poll respondents who ranked the given team in their top 3 favorites} +#' \item{other_gop}{Number of republican poll respondents who identified their race as "other" (not Asian, Black, Hispanic, or White) and ranked the given team in their top 3 favorites} +#' \item{white_gop}{Number of White, republican poll respondents who ranked the given team in their top 3 favorites} #' \item{total_gop}{Total number of republican poll respondents who ranked the given team in their top 3 favorites} #' \item{gop_percent}{Percent of fans (who ranked the team in their top 3 favorite NFL teams) who are republicans} #' \item{dem_percent}{Percent of fans who are democrats} #' \item{ind_percent}{Percent of fans who are independent} -#' \item{white_percent}{Percent of fans who are white} -#' \item{nonwhite_percent}{Percent of fans who are not white} +#' \item{white_percent}{Percent of fans who are White} +#' \item{nonwhite_percent}{Percent of fans who are not White} #' } #' @source See \url{https://github.com/fivethirtyeight/data/tree/master/nfl-fandom/NFL_fandom_data-surveymonkey.csv} #' @examples @@ -421,8 +433,8 @@ #' \item{weight}{The weight fivethirtyeight gives the poll when determining approval ratings based on historical accuracy of the pollster} #' \item{approve}{The percentage of respondents who approve of the president} #' \item{disapprove}{The percentage of respondents who disapprove of the president} -#' \item{adjusted_approve}{The percentage of respondets who approve of the president adjusted for systematic tendencies of the polling firm} -#' \item{adjusted_disapprove}{The percentage of respondets who approve of the president adjusted for systematic tendencies of the polling firm} +#' \item{adjusted_approve}{The percentage of respondents who approve of the president adjusted for systematic tendencies of the polling firm} +#' \item{adjusted_disapprove}{The percentage of respondents who approve of the president adjusted for systematic tendencies of the polling firm} #' \item{multiversions}{True if there are multiple versions of the poll, False if there are not} #' \item{tracking}{TRUE if the poll was tracked, FALSE if not} #' \item{url}{Poll result URL} @@ -499,7 +511,7 @@ #' \url{https://fivethirtyeight.com/features/what-the-world-thinks-of-trump/}: #' Trump World Polls Dataset. #' -#' @format A data frame with 32 rows representng years and 40 variables: +#' @format A data frame with 32 rows representing years and 40 variables: #' \describe{ #' \item{year}{Year the poll was conducted} #' \item{avg}{The average percentage people who answered the poll question positively (support the president or have a favorable view of the U.S.)} @@ -522,7 +534,7 @@ #' \item{philippines}{The percentage of people from the Philippines who answered the poll question positively} #' \item{south_korea}{The percentage of people from South Korea who answered the poll question positively} #' \item{vietnam}{The percentage of people from Vietnam who answered the poll question positively} -#' \item{israel}{The percentage of people from Isreal who answered the poll question positively} +#' \item{israel}{The percentage of people from Israel who answered the poll question positively} #' \item{jordan}{The percentage of people from Jordan who answered the poll question positively} #' \item{lebanon}{The percentage of people from Lebanon who answered the poll question positively} #' \item{tunisia}{The percentage of people from Tunisia who answered the poll question positively} @@ -540,7 +552,7 @@ #' \item{mexico}{The percentage of people from Mexico who answered the poll question positively} #' \item{peru}{The percentage of people from Peru who answered the poll question positively} #' \item{venezuela}{The percentage of people from Venezuela who answered the poll question positively} -#' \item{question}{The item being polled. Specificially, whether respondents: 1) Have a favorable view of the U.S. or 2) Trust the U.S. President when it comes to foreign affairs} +#' \item{question}{The item being polled. Specifically, whether respondents: 1) Have a favorable view of the U.S. or 2) Trust the U.S. President when it comes to foreign affairs} #' } #' @source Pew Research Center \url{http://www.pewresearch.org/fact-tank/2017/07/17/9-charts-on-how-the-world-sees-trump/} #' @examples diff --git a/R/data_meredith.R b/R/data_meredith.R index 9e3f3a9..04a6f0c 100644 --- a/R/data_meredith.R +++ b/R/data_meredith.R @@ -10,7 +10,7 @@ #' \item{end}{End date of the poll.} #' \item{pollster}{The entity that conducts and collects information from the poll.} #' \item{favor}{The number of affirmative responses to the question at the pollster.} -#' \item{oppose}{The number of negative reponses to the question at the pollster.} +#' \item{oppose}{The number of negative responses to the question at the pollster.} #' \item{url}{The website associated with the polling question.} #' \item{text}{The polling question asked at the pollster.} #' } @@ -28,9 +28,9 @@ #' Bachelorette / Bachelor #' #' The raw data behind the stories: -#' "How To Spot A Front-Runner On The ‘Bachelor’ Or ‘Bachelorette’" -#' \url{https://fivethirtyeight.com/features/the-bachelorette/}, "Rachel’s Season Is Fitting Neatly Into ‘Bachelorette’ History" -#' \url{https://fivethirtyeight.com/features/rachels-season-is-fitting-neatly-into-bachelorette-history/}, and "Rachel Lindsay’s ‘Bachelorette’ Season, In Three Charts" +#' "How To Spot A Front-Runner On The 'Bachelor' Or 'Bachelorette'" +#' \url{https://fivethirtyeight.com/features/the-bachelorette/}, "Rachel's Season Is Fitting Neatly Into 'Bachelorette' History" +#' \url{https://fivethirtyeight.com/features/rachels-season-is-fitting-neatly-into-bachelorette-history/}, and "Rachel Lindsay's 'Bachelorette' Season, In Three Charts" #' \url{https://fivethirtyeight.com/features/rachel-lindsays-bachelorette-season-in-three-charts/}. #' #' @format A data frame with 887 rows representing the Bachelorette and Bachelor contestants and 23 variables: @@ -60,14 +60,14 @@ #' \item{dates_10}{Who was on which date in week 10.} #' } #' @details Eliminates connote either an elimination (starts with "E") or a rose -#' (starts with "R"). Eliminations supercede roses. "E" connotes a standard +#' (starts with "R"). Eliminations supersede roses. "E" connotes a standard #' elimination, typically at a rose ceremony. "EQ" means the contestant quits. #' "EF" means the contestant was fired by production. "ED" connotes a date #' elimination. "EU" connotes an unscheduled elimination, one that takes place #' at a time outside of a date or rose ceremony. "R" means the contestant #' received a rose. "R1" means the contestant got a first impression rose. #' "D1" means a one-on-one date, "D2" means a 2-on-1, "D3" means a 3-on-1 -#' group date, and so on. Weeks of the show are deliminated by rose +#' group date, and so on. Weeks of the show are eliminated by rose #' ceremonies, and may not line up exactly with episodes. #' @source \url{http://bachelor-nation.wikia.com/wiki/Bachelor_Nation_Wikia} #' and then missing seasons were filled in by ABC and FiveThirtyEight staffers. @@ -117,9 +117,9 @@ #' @format A data frame with 932 rows representing international player transfers and 5 variables: #' \describe{ #' \item{url}{The corresponding website on the World Chess Federation page which details the transfers of a given year.} -#' \item{id}{An numeric identifier for the chess player who transfered.} +#' \item{id}{An numeric identifier for the chess player who transferred.} #' \item{federation}{The current national federation of the chess player} -#' \item{form_fed}{The national federation from which the chress player has transfered.} +#' \item{form_fed}{The national federation from which the chess player has transferred.} #' \item{transfer_date}{The date at which the transfer took place.} #' } #' @source World Chess Federation @@ -191,7 +191,7 @@ #' An Inconvenient Sequel #' #' The raw data behind the story -#' "Al Gore’s New Movie Exposes The Big Flaw In Online Movie Ratings" +#' "Al Gore's New Movie Exposes The Big Flaw In Online Movie Ratings" #' \url{https://fivethirtyeight.com/features/al-gores-new-movie-exposes-the-big-flaw-in-online-movie-ratings/}. #' #' @format A data frame with 80053 rows representing movie ratings and 27 variables: @@ -243,7 +243,9 @@ #' "The Mayweather-McGregor Fight As Told Through Emojis" #' \url{https://fivethirtyeight.com/?post_type=fte_features&p=161615}. #' -#' @format A data frame with 12118 rows representing tweets and 7 variables: +#' @format Because of R package size restrictions, only a preview of the +#' first 10 rows of this dataset is included; to obtain the entire dataset +#' (12118 rows) see Examples below. A data frame with 10 rows representing tweets and 7 variables: #' \describe{ #' \item{created_at}{Time and date at which the tweet associated with the Mayweather vs. McGregor fight was sent.} #' \item{emojis}{Whether or not emojis were used in the tweet about the fight.} @@ -258,6 +260,19 @@ #' #MayweatherVMcGregor, #MayweatherVsMcGregor, #McGregor and #Mayweather. #' Data was collected on August 27, 2017 between 12:05 a.m. and 1:15 a.m. EDT #' using the Twitter streaming API. \url{https://github.com/fivethirtyeight/data/tree/master/mayweather-mcgregor} +#' @examples +#' # To obtain the entire dataset, run the code inside the following if statement: +#' if(FALSE){ +#' library(tidyverse) +#' url <- +#' "https://raw.githubusercontent.com/fivethirtyeight/data/master/mayweather-mcgregor/tweets.csv" +#' mayweather_mcgregor_tweets <- read_csv(url) %>% +#' mutate( +#' emojis = as.logical(emojis), +#' retweeted = as.logical(retweeted), +#' id = as.character(id) +#' ) +#' } "mayweather_mcgregor_tweets" diff --git a/data/mayweather_mcgregor_tweets.rda b/data/mayweather_mcgregor_tweets.rda index c772956..91b8ac2 100644 Binary files a/data/mayweather_mcgregor_tweets.rda and b/data/mayweather_mcgregor_tweets.rda differ diff --git a/data/mlb_elo.rda b/data/mlb_elo.rda index c644602..b118bac 100644 Binary files a/data/mlb_elo.rda and b/data/mlb_elo.rda differ diff --git a/data/nfl_elo.rda b/data/nfl_elo.rda index aca2bdf..5823c07 100644 Binary files a/data/nfl_elo.rda and b/data/nfl_elo.rda differ diff --git a/docs/LICENSE.html b/docs/LICENSE.html index 9904f03..d1b24db 100644 --- a/docs/LICENSE.html +++ b/docs/LICENSE.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -134,7 +137,7 @@

    License

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/articles/NBA.html b/docs/articles/NBA.html index 3e525f2..dfaa0c1 100644 --- a/docs/articles/NBA.html +++ b/docs/articles/NBA.html @@ -68,6 +68,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -97,7 +100,7 @@

    2015 NBA player predictions analysis using the tidyverse

    G. Elliott Morris and Chester Ismay

    -

    2018-02-09

    +

    2018-02-11

    @@ -123,21 +126,21 @@

    ## # A tibble: 15 x 2
     ##    draft_year mean_proj_spm
     ##         <int>         <dbl>
    -##  1       2001    -0.7433745
    -##  2       2002    -0.8535697
    -##  3       2003    -1.0037065
    -##  4       2004    -0.9616403
    -##  5       2005    -0.7915238
    -##  6       2006    -0.8855274
    -##  7       2007    -0.8446639
    -##  8       2008    -0.8310443
    -##  9       2009    -0.8784884
    -## 10       2010    -0.8406320
    -## 11       2011    -0.7535743
    -## 12       2012    -0.7290506
    -## 13       2013    -0.7729383
    -## 14       2014    -0.7031637
    -## 15       2015    -0.6158276
    +## 1 2001 -0.743 +## 2 2002 -0.854 +## 3 2003 -1.00 +## 4 2004 -0.962 +## 5 2005 -0.792 +## 6 2006 -0.886 +## 7 2007 -0.845 +## 8 2008 -0.831 +## 9 2009 -0.878 +## 10 2010 -0.841 +## 11 2011 -0.754 +## 12 2012 -0.729 +## 13 2013 -0.773 +## 14 2014 -0.703 +## 15 2015 -0.616

    @@ -167,14 +170,14 @@

    select(player, position, draft_year, projected_spm)

    ## # A tibble: 6 x 4
     ## # Groups:   draft_year [2]
    -##            player position draft_year projected_spm
    -##             <chr>    <chr>      <int>         <dbl>
    -## 1  Andre Iguodala       SG       2004     0.7235079
    -## 2       Luol Deng       SF       2004     0.4021089
    -## 3    Emeka Okafor       PF       2004     0.3828638
    -## 4     Dwyane Wade       SG       2003     0.7387024
    -## 5     Chris Kaman        C       2003     0.4069592
    -## 6 Carmelo Anthony       SF       2003     0.3640098
    +## player position draft_year projected_spm +## <chr> <chr> <int> <dbl> +## 1 Andre Iguodala SG 2004 0.724 +## 2 Luol Deng SF 2004 0.402 +## 3 Emeka Okafor PF 2004 0.383 +## 4 Dwyane Wade SG 2003 0.739 +## 5 Chris Kaman C 2003 0.407 +## 6 Carmelo Anthony SF 2003 0.364

    If you are familiar with NBA basketball, these names will stick out to you. Dwayne Wade and Carmelo Anthony are perennial all-stars and Andre Iguodala was the 2015 NBA Finals MVP. (Note that LeBron James is not in this data.)

    The surprising thing here is that these great players were not able to counter-balance the players with low projected_spm. Remember that the mean was used here so even if the great players were outliers (in the positive direction) they weren’t able to pull the mean in their direction. Also note that not all of the players listed in this data set ended up playing in the NBA or, if they did, potentially only played a small amount of time.

    @@ -201,7 +204,7 @@

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/articles/NBA_files/figure-html/graph-1.png b/docs/articles/NBA_files/figure-html/graph-1.png index 606c463..b54c04b 100644 Binary files a/docs/articles/NBA_files/figure-html/graph-1.png and b/docs/articles/NBA_files/figure-html/graph-1.png differ diff --git a/docs/articles/bechdel.html b/docs/articles/bechdel.html index 569f17c..9cfbb4d 100644 --- a/docs/articles/bechdel.html +++ b/docs/articles/bechdel.html @@ -68,6 +68,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -95,9 +98,9 @@ @@ -149,25 +152,25 @@

    ROI_by_binary
    ## # A tibble: 2 x 2
     ##   binary median_ROI
    -##    <chr>      <dbl>
    -## 1   FAIL   2.454209
    -## 2   PASS   2.696553
    +## <chr> <dbl> +## 1 FAIL 2.45 +## 2 PASS 2.70
    bechdel90_13 %>% 
       summarize(
         `Median Overall Return on Investment` = median(roi_total, na.rm = TRUE))
    ## # A tibble: 1 x 1
     ##   `Median Overall Return on Investment`
     ##                                   <dbl>
    -## 1                              2.569013
    +## 1 2.57
    budget_by_binary <- bechdel90_13 %>% 
       group_by(binary) %>% 
       summarize(median_budget = median(budget_2013, na.rm = TRUE))
     budget_by_binary
    ## # A tibble: 2 x 2
     ##   binary median_budget
    -##    <chr>         <dbl>
    -## 1   FAIL      48385984
    -## 2   PASS      31070724
    +## <chr> <dbl> +## 1 FAIL 48385984 +## 2 PASS 31070724
    bechdel90_13 %>% 
       summarize(`Median Overall Budget` = median(budget_2013, na.rm = TRUE))
    ## # A tibble: 1 x 1
    @@ -389,7 +392,7 @@ 

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/articles/bechdel_files/figure-html/basic-538-1.png b/docs/articles/bechdel_files/figure-html/basic-538-1.png index 1657eba..3276d6b 100644 Binary files a/docs/articles/bechdel_files/figure-html/basic-538-1.png and b/docs/articles/bechdel_files/figure-html/basic-538-1.png differ diff --git a/docs/articles/bechdel_files/figure-html/roi-plot-538-1.png b/docs/articles/bechdel_files/figure-html/roi-plot-538-1.png index e3efcd4..5691512 100644 Binary files a/docs/articles/bechdel_files/figure-html/roi-plot-538-1.png and b/docs/articles/bechdel_files/figure-html/roi-plot-538-1.png differ diff --git a/docs/articles/bechdel_files/figure-html/scatplot2-1.png b/docs/articles/bechdel_files/figure-html/scatplot2-1.png index 2bf9864..cb18a89 100644 Binary files a/docs/articles/bechdel_files/figure-html/scatplot2-1.png and b/docs/articles/bechdel_files/figure-html/scatplot2-1.png differ diff --git a/docs/articles/bechdel_files/figure-html/scatplot4-1.png b/docs/articles/bechdel_files/figure-html/scatplot4-1.png index eb6f5e5..625672e 100644 Binary files a/docs/articles/bechdel_files/figure-html/scatplot4-1.png and b/docs/articles/bechdel_files/figure-html/scatplot4-1.png differ diff --git a/docs/articles/biopics.html b/docs/articles/biopics.html index 0276dd8..25465e0 100644 --- a/docs/articles/biopics.html +++ b/docs/articles/biopics.html @@ -68,6 +68,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -90,7 +93,7 @@ - +
    @@ -99,7 +102,7 @@

    Looking at Biopics of Hollywood

    Pradeep Adhokshaja

    -

    09 February, 2018

    +

    11 February, 2018

    @@ -189,8 +192,8 @@

    mutate(n=round(n,2)) %>% hchart("treemap", hcaes(x = type_of_subject, value = n, color = n)) %>% hc_title(text="Type of Subjects of Movies involving White Actors(%)") -
    -

    Actors of Color

    +
    +

    Actors of Color

    biopics %>% 
       mutate(person_of_color=ifelse(person_of_color==0,"White","Person of Color")) %>%
       group_by(person_of_color,type_of_subject) %>% 
    @@ -200,8 +203,8 @@ 

    mutate(n=round(n,2)) %>% hchart("treemap", hcaes(x = type_of_subject, value = n, color = n)) %>% hc_title(text="Type of Subjects of Movies involving Actors of Color(%)")

    -
    -

    A side by side comparison

    +
    +

    A side by side comparison

    biopics %>% 
       mutate(person_of_color = ifelse(person_of_color==0,"White","Person of Color")) %>%
       group_by(person_of_color,type_of_subject) %>% 
    @@ -479,7 +482,7 @@ 

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/articles/biopics_files/figure-html/unnamed-chunk-10-1.png b/docs/articles/biopics_files/figure-html/unnamed-chunk-10-1.png index 96c8b2c..bc0ea98 100644 Binary files a/docs/articles/biopics_files/figure-html/unnamed-chunk-10-1.png and b/docs/articles/biopics_files/figure-html/unnamed-chunk-10-1.png differ diff --git a/docs/articles/biopics_files/figure-html/unnamed-chunk-11-1.png b/docs/articles/biopics_files/figure-html/unnamed-chunk-11-1.png index 0683a40..955b279 100644 Binary files a/docs/articles/biopics_files/figure-html/unnamed-chunk-11-1.png and b/docs/articles/biopics_files/figure-html/unnamed-chunk-11-1.png differ diff --git a/docs/articles/biopics_files/figure-html/unnamed-chunk-12-1.png b/docs/articles/biopics_files/figure-html/unnamed-chunk-12-1.png index 666e20a..f71595d 100644 Binary files a/docs/articles/biopics_files/figure-html/unnamed-chunk-12-1.png and b/docs/articles/biopics_files/figure-html/unnamed-chunk-12-1.png differ diff --git a/docs/articles/biopics_files/figure-html/unnamed-chunk-13-1.png b/docs/articles/biopics_files/figure-html/unnamed-chunk-13-1.png index 0d9a34a..abfbecf 100644 Binary files a/docs/articles/biopics_files/figure-html/unnamed-chunk-13-1.png and b/docs/articles/biopics_files/figure-html/unnamed-chunk-13-1.png differ diff --git a/docs/articles/biopics_files/figure-html/unnamed-chunk-4-1.png b/docs/articles/biopics_files/figure-html/unnamed-chunk-4-1.png index 1d7fd68..44e23ea 100644 Binary files a/docs/articles/biopics_files/figure-html/unnamed-chunk-4-1.png and b/docs/articles/biopics_files/figure-html/unnamed-chunk-4-1.png differ diff --git a/docs/articles/biopics_files/figure-html/unnamed-chunk-7-1.png b/docs/articles/biopics_files/figure-html/unnamed-chunk-7-1.png index 55d70c2..05f59a9 100644 Binary files a/docs/articles/biopics_files/figure-html/unnamed-chunk-7-1.png and b/docs/articles/biopics_files/figure-html/unnamed-chunk-7-1.png differ diff --git a/docs/articles/biopics_files/figure-html/unnamed-chunk-8-1.png b/docs/articles/biopics_files/figure-html/unnamed-chunk-8-1.png index adee5fb..c7f38fb 100644 Binary files a/docs/articles/biopics_files/figure-html/unnamed-chunk-8-1.png and b/docs/articles/biopics_files/figure-html/unnamed-chunk-8-1.png differ diff --git a/docs/articles/biopics_files/figure-html/unnamed-chunk-9-1.png b/docs/articles/biopics_files/figure-html/unnamed-chunk-9-1.png index 104ee50..b7d1b8f 100644 Binary files a/docs/articles/biopics_files/figure-html/unnamed-chunk-9-1.png and b/docs/articles/biopics_files/figure-html/unnamed-chunk-9-1.png differ diff --git a/docs/articles/biopics_files/htmlwidgets-1.0/htmlwidgets.js b/docs/articles/biopics_files/htmlwidgets-1.0/htmlwidgets.js new file mode 100644 index 0000000..ecda3ef --- /dev/null +++ b/docs/articles/biopics_files/htmlwidgets-1.0/htmlwidgets.js @@ -0,0 +1,836 @@ +(function() { + // If window.HTMLWidgets is already defined, then use it; otherwise create a + // new object. This allows preceding code to set options that affect the + // initialization process (though none currently exist). + window.HTMLWidgets = window.HTMLWidgets || {}; + + // See if we're running in a viewer pane. If not, we're in a web browser. + var viewerMode = window.HTMLWidgets.viewerMode = + /\bviewer_pane=1\b/.test(window.location); + + // See if we're running in Shiny mode. If not, it's a static document. + // Note that static widgets can appear in both Shiny and static modes, but + // obviously, Shiny widgets can only appear in Shiny apps/documents. + var shinyMode = window.HTMLWidgets.shinyMode = + typeof(window.Shiny) !== "undefined" && !!window.Shiny.outputBindings; + + // We can't count on jQuery being available, so we implement our own + // version if necessary. + function querySelectorAll(scope, selector) { + if (typeof(jQuery) !== "undefined" && scope instanceof jQuery) { + return scope.find(selector); + } + if (scope.querySelectorAll) { + return scope.querySelectorAll(selector); + } + } + + function asArray(value) { + if (value === null) + return []; + if ($.isArray(value)) + return value; + return [value]; + } + + // Implement jQuery's extend + function extend(target /*, ... */) { + if (arguments.length == 1) { + return target; + } + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + for (var prop in source) { + if (source.hasOwnProperty(prop)) { + target[prop] = source[prop]; + } + } + } + return target; + } + + // IE8 doesn't support Array.forEach. + function forEach(values, callback, thisArg) { + if (values.forEach) { + values.forEach(callback, thisArg); + } else { + for (var i = 0; i < values.length; i++) { + callback.call(thisArg, values[i], i, values); + } + } + } + + // Replaces the specified method with the return value of funcSource. + // + // Note that funcSource should not BE the new method, it should be a function + // that RETURNS the new method. funcSource receives a single argument that is + // the overridden method, it can be called from the new method. The overridden + // method can be called like a regular function, it has the target permanently + // bound to it so "this" will work correctly. + function overrideMethod(target, methodName, funcSource) { + var superFunc = target[methodName] || function() {}; + var superFuncBound = function() { + return superFunc.apply(target, arguments); + }; + target[methodName] = funcSource(superFuncBound); + } + + // Add a method to delegator that, when invoked, calls + // delegatee.methodName. If there is no such method on + // the delegatee, but there was one on delegator before + // delegateMethod was called, then the original version + // is invoked instead. + // For example: + // + // var a = { + // method1: function() { console.log('a1'); } + // method2: function() { console.log('a2'); } + // }; + // var b = { + // method1: function() { console.log('b1'); } + // }; + // delegateMethod(a, b, "method1"); + // delegateMethod(a, b, "method2"); + // a.method1(); + // a.method2(); + // + // The output would be "b1", "a2". + function delegateMethod(delegator, delegatee, methodName) { + var inherited = delegator[methodName]; + delegator[methodName] = function() { + var target = delegatee; + var method = delegatee[methodName]; + + // The method doesn't exist on the delegatee. Instead, + // call the method on the delegator, if it exists. + if (!method) { + target = delegator; + method = inherited; + } + + if (method) { + return method.apply(target, arguments); + } + }; + } + + // Implement a vague facsimilie of jQuery's data method + function elementData(el, name, value) { + if (arguments.length == 2) { + return el["htmlwidget_data_" + name]; + } else if (arguments.length == 3) { + el["htmlwidget_data_" + name] = value; + return el; + } else { + throw new Error("Wrong number of arguments for elementData: " + + arguments.length); + } + } + + // http://stackoverflow.com/questions/3446170/escape-string-for-use-in-javascript-regex + function escapeRegExp(str) { + return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); + } + + function hasClass(el, className) { + var re = new RegExp("\\b" + escapeRegExp(className) + "\\b"); + return re.test(el.className); + } + + // elements - array (or array-like object) of HTML elements + // className - class name to test for + // include - if true, only return elements with given className; + // if false, only return elements *without* given className + function filterByClass(elements, className, include) { + var results = []; + for (var i = 0; i < elements.length; i++) { + if (hasClass(elements[i], className) == include) + results.push(elements[i]); + } + return results; + } + + function on(obj, eventName, func) { + if (obj.addEventListener) { + obj.addEventListener(eventName, func, false); + } else if (obj.attachEvent) { + obj.attachEvent(eventName, func); + } + } + + function off(obj, eventName, func) { + if (obj.removeEventListener) + obj.removeEventListener(eventName, func, false); + else if (obj.detachEvent) { + obj.detachEvent(eventName, func); + } + } + + // Translate array of values to top/right/bottom/left, as usual with + // the "padding" CSS property + // https://developer.mozilla.org/en-US/docs/Web/CSS/padding + function unpackPadding(value) { + if (typeof(value) === "number") + value = [value]; + if (value.length === 1) { + return {top: value[0], right: value[0], bottom: value[0], left: value[0]}; + } + if (value.length === 2) { + return {top: value[0], right: value[1], bottom: value[0], left: value[1]}; + } + if (value.length === 3) { + return {top: value[0], right: value[1], bottom: value[2], left: value[1]}; + } + if (value.length === 4) { + return {top: value[0], right: value[1], bottom: value[2], left: value[3]}; + } + } + + // Convert an unpacked padding object to a CSS value + function paddingToCss(paddingObj) { + return paddingObj.top + "px " + paddingObj.right + "px " + paddingObj.bottom + "px " + paddingObj.left + "px"; + } + + // Makes a number suitable for CSS + function px(x) { + if (typeof(x) === "number") + return x + "px"; + else + return x; + } + + // Retrieves runtime widget sizing information for an element. + // The return value is either null, or an object with fill, padding, + // defaultWidth, defaultHeight fields. + function sizingPolicy(el) { + var sizingEl = document.querySelector("script[data-for='" + el.id + "'][type='application/htmlwidget-sizing']"); + if (!sizingEl) + return null; + var sp = JSON.parse(sizingEl.textContent || sizingEl.text || "{}"); + if (viewerMode) { + return sp.viewer; + } else { + return sp.browser; + } + } + + // @param tasks Array of strings (or falsy value, in which case no-op). + // Each element must be a valid JavaScript expression that yields a + // function. Or, can be an array of objects with "code" and "data" + // properties; in this case, the "code" property should be a string + // of JS that's an expr that yields a function, and "data" should be + // an object that will be added as an additional argument when that + // function is called. + // @param target The object that will be "this" for each function + // execution. + // @param args Array of arguments to be passed to the functions. (The + // same arguments will be passed to all functions.) + function evalAndRun(tasks, target, args) { + if (tasks) { + forEach(tasks, function(task) { + var theseArgs = args; + if (typeof(task) === "object") { + theseArgs = theseArgs.concat([task.data]); + task = task.code; + } + var taskFunc = eval("(" + task + ")"); + if (typeof(taskFunc) !== "function") { + throw new Error("Task must be a function! Source:\n" + task); + } + taskFunc.apply(target, theseArgs); + }); + } + } + + function initSizing(el) { + var sizing = sizingPolicy(el); + if (!sizing) + return; + + var cel = document.getElementById("htmlwidget_container"); + if (!cel) + return; + + if (typeof(sizing.padding) !== "undefined") { + document.body.style.margin = "0"; + document.body.style.padding = paddingToCss(unpackPadding(sizing.padding)); + } + + if (sizing.fill) { + document.body.style.overflow = "hidden"; + document.body.style.width = "100%"; + document.body.style.height = "100%"; + document.documentElement.style.width = "100%"; + document.documentElement.style.height = "100%"; + if (cel) { + cel.style.position = "absolute"; + var pad = unpackPadding(sizing.padding); + cel.style.top = pad.top + "px"; + cel.style.right = pad.right + "px"; + cel.style.bottom = pad.bottom + "px"; + cel.style.left = pad.left + "px"; + el.style.width = "100%"; + el.style.height = "100%"; + } + + return { + getWidth: function() { return cel.offsetWidth; }, + getHeight: function() { return cel.offsetHeight; } + }; + + } else { + el.style.width = px(sizing.width); + el.style.height = px(sizing.height); + + return { + getWidth: function() { return el.offsetWidth; }, + getHeight: function() { return el.offsetHeight; } + }; + } + } + + // Default implementations for methods + var defaults = { + find: function(scope) { + return querySelectorAll(scope, "." + this.name); + }, + renderError: function(el, err) { + var $el = $(el); + + this.clearError(el); + + // Add all these error classes, as Shiny does + var errClass = "shiny-output-error"; + if (err.type !== null) { + // use the classes of the error condition as CSS class names + errClass = errClass + " " + $.map(asArray(err.type), function(type) { + return errClass + "-" + type; + }).join(" "); + } + errClass = errClass + " htmlwidgets-error"; + + // Is el inline or block? If inline or inline-block, just display:none it + // and add an inline error. + var display = $el.css("display"); + $el.data("restore-display-mode", display); + + if (display === "inline" || display === "inline-block") { + $el.hide(); + if (err.message !== "") { + var errorSpan = $("").addClass(errClass); + errorSpan.text(err.message); + $el.after(errorSpan); + } + } else if (display === "block") { + // If block, add an error just after the el, set visibility:none on the + // el, and position the error to be on top of the el. + // Mark it with a unique ID and CSS class so we can remove it later. + $el.css("visibility", "hidden"); + if (err.message !== "") { + var errorDiv = $("
    ").addClass(errClass).css("position", "absolute") + .css("top", el.offsetTop) + .css("left", el.offsetLeft) + // setting width can push out the page size, forcing otherwise + // unnecessary scrollbars to appear and making it impossible for + // the element to shrink; so use max-width instead + .css("maxWidth", el.offsetWidth) + .css("height", el.offsetHeight); + errorDiv.text(err.message); + $el.after(errorDiv); + + // Really dumb way to keep the size/position of the error in sync with + // the parent element as the window is resized or whatever. + var intId = setInterval(function() { + if (!errorDiv[0].parentElement) { + clearInterval(intId); + return; + } + errorDiv + .css("top", el.offsetTop) + .css("left", el.offsetLeft) + .css("maxWidth", el.offsetWidth) + .css("height", el.offsetHeight); + }, 500); + } + } + }, + clearError: function(el) { + var $el = $(el); + var display = $el.data("restore-display-mode"); + $el.data("restore-display-mode", null); + + if (display === "inline" || display === "inline-block") { + if (display) + $el.css("display", display); + $(el.nextSibling).filter(".htmlwidgets-error").remove(); + } else if (display === "block"){ + $el.css("visibility", "inherit"); + $(el.nextSibling).filter(".htmlwidgets-error").remove(); + } + }, + sizing: {} + }; + + // Called by widget bindings to register a new type of widget. The definition + // object can contain the following properties: + // - name (required) - A string indicating the binding name, which will be + // used by default as the CSS classname to look for. + // - initialize (optional) - A function(el) that will be called once per + // widget element; if a value is returned, it will be passed as the third + // value to renderValue. + // - renderValue (required) - A function(el, data, initValue) that will be + // called with data. Static contexts will cause this to be called once per + // element; Shiny apps will cause this to be called multiple times per + // element, as the data changes. + window.HTMLWidgets.widget = function(definition) { + if (!definition.name) { + throw new Error("Widget must have a name"); + } + if (!definition.type) { + throw new Error("Widget must have a type"); + } + // Currently we only support output widgets + if (definition.type !== "output") { + throw new Error("Unrecognized widget type '" + definition.type + "'"); + } + // TODO: Verify that .name is a valid CSS classname + + // Support new-style instance-bound definitions. Old-style class-bound + // definitions have one widget "object" per widget per type/class of + // widget; the renderValue and resize methods on such widget objects + // take el and instance arguments, because the widget object can't + // store them. New-style instance-bound definitions have one widget + // object per widget instance; the definition that's passed in doesn't + // provide renderValue or resize methods at all, just the single method + // factory(el, width, height) + // which returns an object that has renderValue(x) and resize(w, h). + // This enables a far more natural programming style for the widget + // author, who can store per-instance state using either OO-style + // instance fields or functional-style closure variables (I guess this + // is in contrast to what can only be called C-style pseudo-OO which is + // what we required before). + if (definition.factory) { + definition = createLegacyDefinitionAdapter(definition); + } + + if (!definition.renderValue) { + throw new Error("Widget must have a renderValue function"); + } + + // For static rendering (non-Shiny), use a simple widget registration + // scheme. We also use this scheme for Shiny apps/documents that also + // contain static widgets. + window.HTMLWidgets.widgets = window.HTMLWidgets.widgets || []; + // Merge defaults into the definition; don't mutate the original definition. + var staticBinding = extend({}, defaults, definition); + overrideMethod(staticBinding, "find", function(superfunc) { + return function(scope) { + var results = superfunc(scope); + // Filter out Shiny outputs, we only want the static kind + return filterByClass(results, "html-widget-output", false); + }; + }); + window.HTMLWidgets.widgets.push(staticBinding); + + if (shinyMode) { + // Shiny is running. Register the definition with an output binding. + // The definition itself will not be the output binding, instead + // we will make an output binding object that delegates to the + // definition. This is because we foolishly used the same method + // name (renderValue) for htmlwidgets definition and Shiny bindings + // but they actually have quite different semantics (the Shiny + // bindings receive data that includes lots of metadata that it + // strips off before calling htmlwidgets renderValue). We can't + // just ignore the difference because in some widgets it's helpful + // to call this.renderValue() from inside of resize(), and if + // we're not delegating, then that call will go to the Shiny + // version instead of the htmlwidgets version. + + // Merge defaults with definition, without mutating either. + var bindingDef = extend({}, defaults, definition); + + // This object will be our actual Shiny binding. + var shinyBinding = new Shiny.OutputBinding(); + + // With a few exceptions, we'll want to simply use the bindingDef's + // version of methods if they are available, otherwise fall back to + // Shiny's defaults. NOTE: If Shiny's output bindings gain additional + // methods in the future, and we want them to be overrideable by + // HTMLWidget binding definitions, then we'll need to add them to this + // list. + delegateMethod(shinyBinding, bindingDef, "getId"); + delegateMethod(shinyBinding, bindingDef, "onValueChange"); + delegateMethod(shinyBinding, bindingDef, "onValueError"); + delegateMethod(shinyBinding, bindingDef, "renderError"); + delegateMethod(shinyBinding, bindingDef, "clearError"); + delegateMethod(shinyBinding, bindingDef, "showProgress"); + + // The find, renderValue, and resize are handled differently, because we + // want to actually decorate the behavior of the bindingDef methods. + + shinyBinding.find = function(scope) { + var results = bindingDef.find(scope); + + // Only return elements that are Shiny outputs, not static ones + var dynamicResults = results.filter(".html-widget-output"); + + // It's possible that whatever caused Shiny to think there might be + // new dynamic outputs, also caused there to be new static outputs. + // Since there might be lots of different htmlwidgets bindings, we + // schedule execution for later--no need to staticRender multiple + // times. + if (results.length !== dynamicResults.length) + scheduleStaticRender(); + + return dynamicResults; + }; + + // Wrap renderValue to handle initialization, which unfortunately isn't + // supported natively by Shiny at the time of this writing. + + shinyBinding.renderValue = function(el, data) { + Shiny.renderDependencies(data.deps); + // Resolve strings marked as javascript literals to objects + if (!(data.evals instanceof Array)) data.evals = [data.evals]; + for (var i = 0; data.evals && i < data.evals.length; i++) { + window.HTMLWidgets.evaluateStringMember(data.x, data.evals[i]); + } + if (!bindingDef.renderOnNullValue) { + if (data.x === null) { + el.style.visibility = "hidden"; + return; + } else { + el.style.visibility = "inherit"; + } + } + if (!elementData(el, "initialized")) { + initSizing(el); + + elementData(el, "initialized", true); + if (bindingDef.initialize) { + var result = bindingDef.initialize(el, el.offsetWidth, + el.offsetHeight); + elementData(el, "init_result", result); + } + } + bindingDef.renderValue(el, data.x, elementData(el, "init_result")); + evalAndRun(data.jsHooks.render, elementData(el, "init_result"), [el, data.x]); + }; + + // Only override resize if bindingDef implements it + if (bindingDef.resize) { + shinyBinding.resize = function(el, width, height) { + // Shiny can call resize before initialize/renderValue have been + // called, which doesn't make sense for widgets. + if (elementData(el, "initialized")) { + bindingDef.resize(el, width, height, elementData(el, "init_result")); + } + }; + } + + Shiny.outputBindings.register(shinyBinding, bindingDef.name); + } + }; + + var scheduleStaticRenderTimerId = null; + function scheduleStaticRender() { + if (!scheduleStaticRenderTimerId) { + scheduleStaticRenderTimerId = setTimeout(function() { + scheduleStaticRenderTimerId = null; + window.HTMLWidgets.staticRender(); + }, 1); + } + } + + // Render static widgets after the document finishes loading + // Statically render all elements that are of this widget's class + window.HTMLWidgets.staticRender = function() { + var bindings = window.HTMLWidgets.widgets || []; + forEach(bindings, function(binding) { + var matches = binding.find(document.documentElement); + forEach(matches, function(el) { + var sizeObj = initSizing(el, binding); + + if (hasClass(el, "html-widget-static-bound")) + return; + el.className = el.className + " html-widget-static-bound"; + + var initResult; + if (binding.initialize) { + initResult = binding.initialize(el, + sizeObj ? sizeObj.getWidth() : el.offsetWidth, + sizeObj ? sizeObj.getHeight() : el.offsetHeight + ); + elementData(el, "init_result", initResult); + } + + if (binding.resize) { + var lastSize = {}; + var resizeHandler = function(e) { + var size = { + w: sizeObj ? sizeObj.getWidth() : el.offsetWidth, + h: sizeObj ? sizeObj.getHeight() : el.offsetHeight + }; + if (size.w === 0 && size.h === 0) + return; + if (size.w === lastSize.w && size.h === lastSize.h) + return; + lastSize = size; + binding.resize(el, size.w, size.h, initResult); + }; + + on(window, "resize", resizeHandler); + + // This is needed for cases where we're running in a Shiny + // app, but the widget itself is not a Shiny output, but + // rather a simple static widget. One example of this is + // an rmarkdown document that has runtime:shiny and widget + // that isn't in a render function. Shiny only knows to + // call resize handlers for Shiny outputs, not for static + // widgets, so we do it ourselves. + if (window.jQuery) { + window.jQuery(document).on( + "shown.htmlwidgets shown.bs.tab.htmlwidgets shown.bs.collapse.htmlwidgets", + resizeHandler + ); + window.jQuery(document).on( + "hidden.htmlwidgets hidden.bs.tab.htmlwidgets hidden.bs.collapse.htmlwidgets", + resizeHandler + ); + } + + // This is needed for the specific case of ioslides, which + // flips slides between display:none and display:block. + // Ideally we would not have to have ioslide-specific code + // here, but rather have ioslides raise a generic event, + // but the rmarkdown package just went to CRAN so the + // window to getting that fixed may be long. + if (window.addEventListener) { + // It's OK to limit this to window.addEventListener + // browsers because ioslides itself only supports + // such browsers. + on(document, "slideenter", resizeHandler); + on(document, "slideleave", resizeHandler); + } + } + + var scriptData = document.querySelector("script[data-for='" + el.id + "'][type='application/json']"); + if (scriptData) { + var data = JSON.parse(scriptData.textContent || scriptData.text); + // Resolve strings marked as javascript literals to objects + if (!(data.evals instanceof Array)) data.evals = [data.evals]; + for (var k = 0; data.evals && k < data.evals.length; k++) { + window.HTMLWidgets.evaluateStringMember(data.x, data.evals[k]); + } + binding.renderValue(el, data.x, initResult); + evalAndRun(data.jsHooks.render, initResult, [el, data.x]); + } + }); + }); + + invokePostRenderHandlers(); + } + + // Wait until after the document has loaded to render the widgets. + if (document.addEventListener) { + document.addEventListener("DOMContentLoaded", function() { + document.removeEventListener("DOMContentLoaded", arguments.callee, false); + window.HTMLWidgets.staticRender(); + }, false); + } else if (document.attachEvent) { + document.attachEvent("onreadystatechange", function() { + if (document.readyState === "complete") { + document.detachEvent("onreadystatechange", arguments.callee); + window.HTMLWidgets.staticRender(); + } + }); + } + + + window.HTMLWidgets.getAttachmentUrl = function(depname, key) { + // If no key, default to the first item + if (typeof(key) === "undefined") + key = 1; + + var link = document.getElementById(depname + "-" + key + "-attachment"); + if (!link) { + throw new Error("Attachment " + depname + "/" + key + " not found in document"); + } + return link.getAttribute("href"); + }; + + window.HTMLWidgets.dataframeToD3 = function(df) { + var names = []; + var length; + for (var name in df) { + if (df.hasOwnProperty(name)) + names.push(name); + if (typeof(df[name]) !== "object" || typeof(df[name].length) === "undefined") { + throw new Error("All fields must be arrays"); + } else if (typeof(length) !== "undefined" && length !== df[name].length) { + throw new Error("All fields must be arrays of the same length"); + } + length = df[name].length; + } + var results = []; + var item; + for (var row = 0; row < length; row++) { + item = {}; + for (var col = 0; col < names.length; col++) { + item[names[col]] = df[names[col]][row]; + } + results.push(item); + } + return results; + }; + + window.HTMLWidgets.transposeArray2D = function(array) { + if (array.length === 0) return array; + var newArray = array[0].map(function(col, i) { + return array.map(function(row) { + return row[i] + }) + }); + return newArray; + }; + // Split value at splitChar, but allow splitChar to be escaped + // using escapeChar. Any other characters escaped by escapeChar + // will be included as usual (including escapeChar itself). + function splitWithEscape(value, splitChar, escapeChar) { + var results = []; + var escapeMode = false; + var currentResult = ""; + for (var pos = 0; pos < value.length; pos++) { + if (!escapeMode) { + if (value[pos] === splitChar) { + results.push(currentResult); + currentResult = ""; + } else if (value[pos] === escapeChar) { + escapeMode = true; + } else { + currentResult += value[pos]; + } + } else { + currentResult += value[pos]; + escapeMode = false; + } + } + if (currentResult !== "") { + results.push(currentResult); + } + return results; + } + // Function authored by Yihui/JJ Allaire + window.HTMLWidgets.evaluateStringMember = function(o, member) { + var parts = splitWithEscape(member, '.', '\\'); + for (var i = 0, l = parts.length; i < l; i++) { + var part = parts[i]; + // part may be a character or 'numeric' member name + if (o !== null && typeof o === "object" && part in o) { + if (i == (l - 1)) { // if we are at the end of the line then evalulate + if (typeof o[part] === "string") + o[part] = eval("(" + o[part] + ")"); + } else { // otherwise continue to next embedded object + o = o[part]; + } + } + } + }; + + // Retrieve the HTMLWidget instance (i.e. the return value of an + // HTMLWidget binding's initialize() or factory() function) + // associated with an element, or null if none. + window.HTMLWidgets.getInstance = function(el) { + return elementData(el, "init_result"); + }; + + // Finds the first element in the scope that matches the selector, + // and returns the HTMLWidget instance (i.e. the return value of + // an HTMLWidget binding's initialize() or factory() function) + // associated with that element, if any. If no element matches the + // selector, or the first matching element has no HTMLWidget + // instance associated with it, then null is returned. + // + // The scope argument is optional, and defaults to window.document. + window.HTMLWidgets.find = function(scope, selector) { + if (arguments.length == 1) { + selector = scope; + scope = document; + } + + var el = scope.querySelector(selector); + if (el === null) { + return null; + } else { + return window.HTMLWidgets.getInstance(el); + } + }; + + // Finds all elements in the scope that match the selector, and + // returns the HTMLWidget instances (i.e. the return values of + // an HTMLWidget binding's initialize() or factory() function) + // associated with the elements, in an array. If elements that + // match the selector don't have an associated HTMLWidget + // instance, the returned array will contain nulls. + // + // The scope argument is optional, and defaults to window.document. + window.HTMLWidgets.findAll = function(scope, selector) { + if (arguments.length == 1) { + selector = scope; + scope = document; + } + + var nodes = scope.querySelectorAll(selector); + var results = []; + for (var i = 0; i < nodes.length; i++) { + results.push(window.HTMLWidgets.getInstance(nodes[i])); + } + return results; + }; + + var postRenderHandlers = []; + function invokePostRenderHandlers() { + while (postRenderHandlers.length) { + var handler = postRenderHandlers.shift(); + if (handler) { + handler(); + } + } + } + + // Register the given callback function to be invoked after the + // next time static widgets are rendered. + window.HTMLWidgets.addPostRenderHandler = function(callback) { + postRenderHandlers.push(callback); + }; + + // Takes a new-style instance-bound definition, and returns an + // old-style class-bound definition. This saves us from having + // to rewrite all the logic in this file to accomodate both + // types of definitions. + function createLegacyDefinitionAdapter(defn) { + var result = { + name: defn.name, + type: defn.type, + initialize: function(el, width, height) { + return defn.factory(el, width, height); + }, + renderValue: function(el, x, instance) { + return instance.renderValue(x); + }, + resize: function(el, width, height, instance) { + return instance.resize(width, height); + } + }; + + if (defn.find) + result.find = defn.find; + if (defn.renderError) + result.renderError = defn.renderError; + if (defn.clearError) + result.clearError = defn.clearError; + + return result; + } +})(); + diff --git a/docs/articles/bob_ross.html b/docs/articles/bob_ross.html index 4d74120..74a0405 100644 --- a/docs/articles/bob_ross.html +++ b/docs/articles/bob_ross.html @@ -68,6 +68,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -96,7 +99,7 @@

    Bob Ross - Joy of Painting-

    Jonathan Bouchet

    -

    2018-02-09

    +

    2018-02-11

    @@ -310,7 +313,7 @@

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/articles/bob_ross_files/figure-html/episode prep.-1.png b/docs/articles/bob_ross_files/figure-html/episode prep.-1.png index e371176..3c03a41 100644 Binary files a/docs/articles/bob_ross_files/figure-html/episode prep.-1.png and b/docs/articles/bob_ross_files/figure-html/episode prep.-1.png differ diff --git a/docs/articles/bob_ross_files/figure-html/episoe plot-1.png b/docs/articles/bob_ross_files/figure-html/episoe plot-1.png index b789bc2..793e9e3 100644 Binary files a/docs/articles/bob_ross_files/figure-html/episoe plot-1.png and b/docs/articles/bob_ross_files/figure-html/episoe plot-1.png differ diff --git a/docs/articles/bob_ross_files/figure-html/feature frequency plot-1.png b/docs/articles/bob_ross_files/figure-html/feature frequency plot-1.png index dc58549..afc7688 100644 Binary files a/docs/articles/bob_ross_files/figure-html/feature frequency plot-1.png and b/docs/articles/bob_ross_files/figure-html/feature frequency plot-1.png differ diff --git a/docs/articles/bob_ross_files/figure-html/network plot-1.png b/docs/articles/bob_ross_files/figure-html/network plot-1.png index c53fd21..e174e3d 100644 Binary files a/docs/articles/bob_ross_files/figure-html/network plot-1.png and b/docs/articles/bob_ross_files/figure-html/network plot-1.png differ diff --git a/docs/articles/comics_gender.html b/docs/articles/comics_gender.html index 6cd57d6..bfeba91 100644 --- a/docs/articles/comics_gender.html +++ b/docs/articles/comics_gender.html @@ -68,6 +68,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -96,7 +99,7 @@

    Gender in Comic Books

    Jonathan Bouchet

    -

    2018-02-09

    +

    2018-02-11

    @@ -332,7 +335,7 @@

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/articles/comics_gender_files/figure-html/unnamed-chunk-2-1.png b/docs/articles/comics_gender_files/figure-html/unnamed-chunk-2-1.png index 3a3ec39..2587cfe 100644 Binary files a/docs/articles/comics_gender_files/figure-html/unnamed-chunk-2-1.png and b/docs/articles/comics_gender_files/figure-html/unnamed-chunk-2-1.png differ diff --git a/docs/articles/comics_gender_files/figure-html/unnamed-chunk-3-1.png b/docs/articles/comics_gender_files/figure-html/unnamed-chunk-3-1.png index f10221d..0227204 100644 Binary files a/docs/articles/comics_gender_files/figure-html/unnamed-chunk-3-1.png and b/docs/articles/comics_gender_files/figure-html/unnamed-chunk-3-1.png differ diff --git a/docs/articles/comics_gender_files/figure-html/unnamed-chunk-7-1.png b/docs/articles/comics_gender_files/figure-html/unnamed-chunk-7-1.png index 836a8a1..8c42a2a 100644 Binary files a/docs/articles/comics_gender_files/figure-html/unnamed-chunk-7-1.png and b/docs/articles/comics_gender_files/figure-html/unnamed-chunk-7-1.png differ diff --git a/docs/articles/fivethirtyeight.html b/docs/articles/fivethirtyeight.html index 08faa3c..a07f593 100644 --- a/docs/articles/fivethirtyeight.html +++ b/docs/articles/fivethirtyeight.html @@ -69,6 +69,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -98,7 +101,7 @@

    fivethirtyeight Package

    Albert Y. Kim, Chester Ismay, and Jennifer Chunn

    -

    2018-02-09

    +

    2018-02-11

    @@ -1310,7 +1313,7 @@

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/articles/index.html b/docs/articles/index.html index dd54f1b..080bc15 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -114,7 +117,7 @@
    @@ -132,6 +135,7 @@

    All vignettes

  • 2015 NBA player predictions analysis using the `tidyverse`
  • How Many Fucks Does Tarantino Give?
  • Trump Twitter analysis using the `tidyverse`
  • +
  • User-Contributed Vignettes
  • @@ -143,7 +147,7 @@

    All vignettes

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/articles/tarantino_swears.html b/docs/articles/tarantino_swears.html index c35e9bb..ffc679e 100644 --- a/docs/articles/tarantino_swears.html +++ b/docs/articles/tarantino_swears.html @@ -68,6 +68,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -96,7 +99,7 @@

    How Many Fucks Does Tarantino Give?

    Olivia Barrows, Jojo Miller, and Jayla Nakayama

    -

    2018-02-09

    +

    2018-02-11

    @@ -153,15 +156,15 @@

    theme(axis.text.x = element_text(angle = 45, hjust = 1))

    ## # A tibble: 7 x 2
    -##                 movie  year
    -##                 <chr> <dbl>
    -## 1      Reservoir Dogs  1992
    -## 2        Pulp Fiction  1994
    -## 3        Jackie Brown  1997
    -## 4   Kill Bill: Vol. 1  2003
    -## 5   Kill Bill: Vol. 2  2004
    +##   movie                year
    +##   <chr>               <dbl>
    +## 1 Reservoir Dogs       1992
    +## 2 Pulp Fiction         1994
    +## 3 Jackie Brown         1997
    +## 4 Kill Bill: Vol. 1    2003
    +## 5 Kill Bill: Vol. 2    2004
     ## 6 Inglorious Basterds  2009
    -## 7    Django Unchained  2012
    +## 7 Django Unchained 2012

    In order to better represent this data available on the profanities used in Tarantino’s movies, it is beneficial to first divide the swear words used into categories via the word variable. For the purposes of this analysis, eight were defined and stored in the swear_category variable:

    • swears including the word ‘ass’
    • @@ -198,16 +201,15 @@

      Unspeakable = Gender + Race) Profanity_Sum
      ## # A tibble: 7 x 10
      -##                 movie   Ass  Shit  Fuck  Dick Damnation Bastard Gender
      -##                 <chr> <dbl> <dbl> <dbl> <dbl>     <dbl>   <dbl>  <dbl>
      -## 1    Django Unchained  11.1   7.3    12  0.00      19.8    0.38    5.7
      -## 2 Inglorious Basterds  10.3  10.3    36  0.00      27.6    0.00    5.2
      -## 3        Jackie Brown  14.4  20.1    38  0.27      12.5    0.00    4.1
      -## 4   Kill Bill: Vol. 1   5.3  17.5    30  3.51      21.1    3.51   19.3
      -## 5   Kill Bill: Vol. 2  13.0  14.5    35  1.45      11.6    4.35   15.9
      -## 6        Pulp Fiction   8.1  16.8    57  0.43       8.7    0.00    3.4
      -## 7      Reservoir Dogs   5.7  13.1    64  4.04       5.7    1.19    4.3
      -## # ... with 2 more variables: Race <dbl>, Unspeakable <dbl>
      +## movie Ass Shit Fuck Dick Damnation Bastard Gender Race Unspeakable +## <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> +## 1 Djan… 11.1 7.25 12.2 0 19.8 0.382 5.73 43.5 49.2 +## 2 Ingl… 10.3 10.3 36.2 0 27.6 0 5.17 10.3 15.5 +## 3 Jack… 14.4 20.1 38.0 0.272 12.5 0 4.08 10.6 14.7 +## 4 Kill… 5.26 17.5 29.8 3.51 21.1 3.51 19.3 0 19.3 +## 5 Kill… 13.0 14.5 34.8 1.45 11.6 4.35 15.9 4.35 20.3 +## 6 Pulp… 8.10 16.8 56.9 0.426 8.74 0 3.41 5.54 8.96 +## 7 Rese… 5.70 13.1 64.4 4.04 5.70 1.19 4.28 1.66 5.94

      This table allows us to conclude the following:

      • Despite what the title would suggest, Inglorious Basterds does not use the word ‘bastard’ at all
      • @@ -225,15 +227,15 @@

        select(-gen_por, -race_por) Unspeakable_Sum
        ## # A tibble: 7 x 3
        -##                 movie Gender_Derogatory Race_Derogatory
        -##                 <chr>             <dbl>           <dbl>
        -## 1    Django Unchained               5.7            43.5
        -## 2 Inglorious Basterds               5.2            10.3
        -## 3        Jackie Brown               4.1            10.6
        -## 4   Kill Bill: Vol. 1              19.3             0.0
        -## 5   Kill Bill: Vol. 2              15.9             4.3
        -## 6        Pulp Fiction               3.4             5.5
        -## 7      Reservoir Dogs               4.3             1.7
        +## movie Gender_Derogatory Race_Derogatory +## <chr> <dbl> <dbl> +## 1 Django Unchained 5.73 43.5 +## 2 Inglorious Basterds 5.17 10.3 +## 3 Jackie Brown 4.08 10.6 +## 4 Kill Bill: Vol. 1 19.3 0 +## 5 Kill Bill: Vol. 2 15.9 4.35 +## 6 Pulp Fiction 3.41 5.54 +## 7 Reservoir Dogs 4.28 1.66

        The resulting table allows us to conclude the following:

        • @@ -305,7 +307,7 @@

          -

          Site built with pkgdown.

          +

          Site built with pkgdown.

          diff --git a/docs/articles/tarantino_swears_files/figure-html/given-1.png b/docs/articles/tarantino_swears_files/figure-html/given-1.png index 90e96d6..a9942e1 100644 Binary files a/docs/articles/tarantino_swears_files/figure-html/given-1.png and b/docs/articles/tarantino_swears_files/figure-html/given-1.png differ diff --git a/docs/articles/tarantino_swears_files/figure-html/plot1-1.png b/docs/articles/tarantino_swears_files/figure-html/plot1-1.png index 4a022f3..48e20da 100644 Binary files a/docs/articles/tarantino_swears_files/figure-html/plot1-1.png and b/docs/articles/tarantino_swears_files/figure-html/plot1-1.png differ diff --git a/docs/articles/tarantino_swears_files/figure-html/type_given-1.png b/docs/articles/tarantino_swears_files/figure-html/type_given-1.png index fba121b..58da2d3 100644 Binary files a/docs/articles/tarantino_swears_files/figure-html/type_given-1.png and b/docs/articles/tarantino_swears_files/figure-html/type_given-1.png differ diff --git a/docs/articles/trump_twitter.html b/docs/articles/trump_twitter.html index 12f97e9..062801b 100644 --- a/docs/articles/trump_twitter.html +++ b/docs/articles/trump_twitter.html @@ -68,6 +68,9 @@
        • Trump Twitter analysis using the `tidyverse`
        • +
        • + User-Contributed Vignettes +
      • @@ -97,7 +100,7 @@

        Trump Twitter analysis using the tidyverse

        Adam Spannbauer and Jennifer Chunn

        -

        2018-02-09

        +

        2018-02-11

        @@ -169,12 +172,12 @@

        trump_full_text_sent %>%
           count(score_factor) %>% mutate(prop = prop.table(n))
        ## # A tibble: 4 x 3
        -##    score_factor     n       prop
        -##           <chr> <int>      <dbl>
        -## 1    -.Negative    59 0.13169643
        -## 2         +.Pos   173 0.38616071
        -## 3             0     8 0.01785714
        -## 4 Missing score   208 0.46428571
        +## score_factor n prop +## <chr> <int> <dbl> +## 1 -.Negative 59 0.132 +## 2 +.Pos 173 0.386 +## 3 0 8 0.0179 +## 4 Missing score 208 0.464

        46.4% of tweets did not have sentiment scores. 15.4% were net negative and 36.6% were net positive.

        ggplot(data=trump_full_text_sent, aes(score)) + geom_histogram(bins = 10)

        @@ -354,7 +357,7 @@

        -

        Site built with pkgdown.

        +

        Site built with pkgdown.

        diff --git a/docs/articles/trump_twitter_files/figure-html/plot_hour-1.png b/docs/articles/trump_twitter_files/figure-html/plot_hour-1.png index 0ac574f..ca66d85 100644 Binary files a/docs/articles/trump_twitter_files/figure-html/plot_hour-1.png and b/docs/articles/trump_twitter_files/figure-html/plot_hour-1.png differ diff --git a/docs/articles/trump_twitter_files/figure-html/plot_month-1.png b/docs/articles/trump_twitter_files/figure-html/plot_month-1.png index 00af725..b62dff2 100644 Binary files a/docs/articles/trump_twitter_files/figure-html/plot_month-1.png and b/docs/articles/trump_twitter_files/figure-html/plot_month-1.png differ diff --git a/docs/articles/trump_twitter_files/figure-html/plot_weekday-1.png b/docs/articles/trump_twitter_files/figure-html/plot_weekday-1.png index bb63a82..1904adf 100644 Binary files a/docs/articles/trump_twitter_files/figure-html/plot_weekday-1.png and b/docs/articles/trump_twitter_files/figure-html/plot_weekday-1.png differ diff --git a/docs/articles/user_contributed_vignettes.R b/docs/articles/user_contributed_vignettes.R new file mode 100644 index 0000000..d908392 --- /dev/null +++ b/docs/articles/user_contributed_vignettes.R @@ -0,0 +1,4 @@ +## ----install, eval=FALSE------------------------------------------------- +# # install.packages("remotes") +# remotes::install_github("rudeboybert/fivethirtyeight", build_vignettes = TRUE) + diff --git a/docs/articles/user_contributed_vignettes.html b/docs/articles/user_contributed_vignettes.html new file mode 100644 index 0000000..b4b8a56 --- /dev/null +++ b/docs/articles/user_contributed_vignettes.html @@ -0,0 +1,164 @@ + + + + + + + +User-Contributed Vignettes • fivethirtyeight + + + + + + +
        +
        + + + +
        +
        + + + + +
        +

        Due to CRAN space limitations on packages, user-contributed vignettes that walk through different analyses using the data sets in the fivethirtyeight package are linked below in this “vignette of vignettes.” You can find both the R Markdown file needed to generate the file and also a link to the HTML vignette on the package website at https://fivethirtyeight-r.netlify.com. The vignette title links to the HTML version and the (Rmd) immediately following links to the R Markdown source. We encourage others to share their analyses using the fivethirtyeight data sets.

        +

        The developmental version of the package stored on GitHub contains all of the vignettes so if you’d like to build the package locally, first install the remotes package and then install the package via

        +
        # install.packages("remotes")
        +remotes::install_github("rudeboybert/fivethirtyeight", build_vignettes = TRUE)
        +
        +

        +Analyses

        + +
        +
        +
        + + + +
        + + +
        + +
        +

        Site built with pkgdown.

        +
        + +
        +
        + + + diff --git a/docs/authors.html b/docs/authors.html index 05b6400..a5d266b 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -91,6 +91,9 @@
      • Trump Twitter analysis using the `tidyverse`
      • +
      • + User-Contributed Vignettes +
    • @@ -204,7 +207,7 @@

      Authors

      -

      Site built with pkgdown.

      +

      Site built with pkgdown.

      diff --git a/docs/index.html b/docs/index.html index 8bc5a1f..96e844b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -68,6 +68,9 @@
    • Trump Twitter analysis using the `tidyverse`
    • +
    • + User-Contributed Vignettes +

  • @@ -111,7 +114,7 @@

    Or the development version from GitHub:

    # If you haven't installed the remotes package yet, do so:
     # install.packages("remotes")
    -remotes::install_github("rudeboybert/fivethirtyeight", build_vignettes = TRUE)
    +remotes::install_github("rudeboybert/fivethirtyeight", build_vignettes = TRUE)

    @@ -240,7 +243,7 @@

    Dev status

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/news/index.html b/docs/news/index.html index b835d06..3652089 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -121,11 +124,13 @@

    Change log All releases

    -
    +

    -fivethirtyeight 0.3.0.9000

    +fivethirtyeight 0.4.0
      -
    • Added new and missing data sets: +
    • Package website now at http://fivethirtyeight-r.netlify.com/ +
    • +
    • Added new data sets:
      • By Meredith Manley: ahca_polls, bachelorette, candy_rankings, chess_transfers, generic_polllist, generic_topline, mlb_elo, ratings, spi_global_rankings, spi_matches, tweets
      • @@ -133,10 +138,17 @@

    • -
    • Package website now at http://fivethirtyeight-r.netlify.com/ -
    • +
    • Note for now mayweather_mcgregor_tweets, mlb_elo, nba_carmelo, nfl_elo, senators, only include the first 10 rows of the data because of R package file size restrictions (< 5MB tarballs); code to download/process the entire dataset are included in help files. We hope to include full versions of these datasets in v0.5.0 of package using the drat package.
    • Converted all ordinal categorical variables to factor(..., ordered = TRUE). Ex: bechdel$clean_test
    • +
    • Vignette notes: +
        +
      • Added a vignette that has a link to all user-contributed vignettes, which areonly available on development version of package and on GitHub due to CRAN package size restrictions.
      • +
      • For all datasets that have a user contributed vignette, add a link to it in the corresponding help/roxygen code file.
      • +
      +
    • +
    • Added CITATION +
    @@ -197,7 +209,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/US_births_1994_2003.html b/docs/reference/US_births_1994_2003.html index cf1e9d5..c3e5be7 100644 --- a/docs/reference/US_births_1994_2003.html +++ b/docs/reference/US_births_1994_2003.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -168,7 +171,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/US_births_2000_2014.html b/docs/reference/US_births_2000_2014.html index a6eea96..c3fc356 100644 --- a/docs/reference/US_births_2000_2014.html +++ b/docs/reference/US_births_2000_2014.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -168,7 +171,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/ahca_polls.html b/docs/reference/ahca_polls.html index d927e9e..98cc4c0 100644 --- a/docs/reference/ahca_polls.html +++ b/docs/reference/ahca_polls.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -134,7 +137,7 @@

    Formatend

    End date of the poll.

    pollster

    The entity that conducts and collects information from the poll.

    favor

    The number of affirmative responses to the question at the pollster.

    -
    oppose

    The number of negative reponses to the question at the pollster.

    +
    oppose

    The number of negative responses to the question at the pollster.

    url

    The website associated with the polling question.

    text

    The polling question asked at the pollster.

    @@ -171,7 +174,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/airline_safety.html b/docs/reference/airline_safety.html index e44c508..2c75b20 100644 --- a/docs/reference/airline_safety.html +++ b/docs/reference/airline_safety.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -178,7 +181,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/antiquities_act.html b/docs/reference/antiquities_act.html index fe46882..b867b63 100644 --- a/docs/reference/antiquities_act.html +++ b/docs/reference/antiquities_act.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -165,7 +168,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/avengers.html b/docs/reference/avengers.html index 45c80dc..00e0c75 100644 --- a/docs/reference/avengers.html +++ b/docs/reference/avengers.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -177,7 +180,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/bachelorette.html b/docs/reference/bachelorette.html index 6a564f1..2157fd1 100644 --- a/docs/reference/bachelorette.html +++ b/docs/reference/bachelorette.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -121,9 +124,9 @@

    Bachelorette / Bachelor

    The raw data behind the stories: -"How To Spot A Front-Runner On The ‘Bachelor’ Or ‘Bachelorette’" -https://fivethirtyeight.com/features/the-bachelorette/, "Rachel’s Season Is Fitting Neatly Into ‘Bachelorette’ History" -https://fivethirtyeight.com/features/rachels-season-is-fitting-neatly-into-bachelorette-history/, and "Rachel Lindsay’s ‘Bachelorette’ Season, In Three Charts" +"How To Spot A Front-Runner On The 'Bachelor' Or 'Bachelorette'" +https://fivethirtyeight.com/features/the-bachelorette/, "Rachel's Season Is Fitting Neatly Into 'Bachelorette' History" +https://fivethirtyeight.com/features/rachels-season-is-fitting-neatly-into-bachelorette-history/, and "Rachel Lindsay's 'Bachelorette' Season, In Three Charts" https://fivethirtyeight.com/features/rachel-lindsays-bachelorette-season-in-three-charts/.

    @@ -165,14 +168,14 @@

    SourceDetails

    Eliminates connote either an elimination (starts with "E") or a rose -(starts with "R"). Eliminations supercede roses. "E" connotes a standard +(starts with "R"). Eliminations supersede roses. "E" connotes a standard elimination, typically at a rose ceremony. "EQ" means the contestant quits. "EF" means the contestant was fired by production. "ED" connotes a date elimination. "EU" connotes an unscheduled elimination, one that takes place at a time outside of a date or rose ceremony. "R" means the contestant received a rose. "R1" means the contestant got a first impression rose. "D1" means a one-on-one date, "D2" means a 2-on-1, "D3" means a 3-on-1 -group date, and so on. Weeks of the show are deliminated by rose +group date, and so on. Weeks of the show are eliminated by rose ceremonies, and may not line up exactly with episodes.

    @@ -197,7 +200,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/bad_drivers.html b/docs/reference/bad_drivers.html index c453c4e..058be0d 100644 --- a/docs/reference/bad_drivers.html +++ b/docs/reference/bad_drivers.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -166,7 +169,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/bechdel.html b/docs/reference/bechdel.html index 8a6cecc..70e1ae3 100644 --- a/docs/reference/bechdel.html +++ b/docs/reference/bechdel.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -178,7 +181,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/biopics.html b/docs/reference/biopics.html index 6932186..ceff752 100644 --- a/docs/reference/biopics.html +++ b/docs/reference/biopics.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -122,7 +125,9 @@

    'Straight Outta Compton' Is The Rare Biopic Not About White Dudes

    The raw data behind the story "'Straight Outta Compton' Is The Rare Biopic Not About White Dudes" -https://fivethirtyeight.com/features/straight-outta-compton-is-the-rare-biopic-not-about-white-dudes/.

    +https://fivethirtyeight.com/features/straight-outta-compton-is-the-rare-biopic-not-about-white-dudes/. +An analysis using this data was contributed by Pradeep Adhokshaja as a package vignette at +http://fivethirtyeight-r.netlify.com/articles/biopics.html.

    biopics
    @@ -170,7 +175,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/bob_ross.html b/docs/reference/bob_ross.html index a6ba25d..206781d 100644 --- a/docs/reference/bob_ross.html +++ b/docs/reference/bob_ross.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -122,7 +125,9 @@

    A Statistical Analysis of the Work of Bob Ross

    The raw data behind the story "A Statistical Analysis of the Work of Bob Ross" -https://fivethirtyeight.com/features/a-statistical-analysis-of-the-work-of-bob-ross/.

    +https://fivethirtyeight.com/features/a-statistical-analysis-of-the-work-of-bob-ross/. +An analysis using this data was contributed by Jonathan Bouchet as a package vignette at +http://fivethirtyeight-r.netlify.com/articles/bob_ross.html.

    bob_ross
    @@ -237,7 +242,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/cand_events_20150114.html b/docs/reference/cand_events_20150114.html index 3c81a5b..e8aa156 100644 --- a/docs/reference/cand_events_20150114.html +++ b/docs/reference/cand_events_20150114.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -170,7 +173,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/cand_events_20150130.html b/docs/reference/cand_events_20150130.html index e695238..fae3b4b 100644 --- a/docs/reference/cand_events_20150130.html +++ b/docs/reference/cand_events_20150130.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -170,7 +173,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/cand_state_20150114.html b/docs/reference/cand_state_20150114.html index 15dec46..b87c135 100644 --- a/docs/reference/cand_state_20150114.html +++ b/docs/reference/cand_state_20150114.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -167,7 +170,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/cand_state_20150130.html b/docs/reference/cand_state_20150130.html index 807aee5..ab48566 100644 --- a/docs/reference/cand_state_20150130.html +++ b/docs/reference/cand_state_20150130.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -167,7 +170,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/candy_rankings.html b/docs/reference/candy_rankings.html index 3dce9b0..67db21d 100644 --- a/docs/reference/candy_rankings.html +++ b/docs/reference/candy_rankings.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -178,7 +181,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/chess_transfers.html b/docs/reference/chess_transfers.html index c959762..b618827 100644 --- a/docs/reference/chess_transfers.html +++ b/docs/reference/chess_transfers.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -130,9 +133,9 @@

    FormatA data frame with 932 rows representing international player transfers and 5 variables:

    url

    The corresponding website on the World Chess Federation page which details the transfers of a given year.

    -
    id

    An numeric identifier for the chess player who transfered.

    +
    id

    An numeric identifier for the chess player who transferred.

    federation

    The current national federation of the chess player

    -
    form_fed

    The national federation from which the chress player has transfered.

    +
    form_fed

    The national federation from which the chess player has transferred.

    transfer_date

    The date at which the transfer took place.

    @@ -160,7 +163,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/classic_rock_raw_data.html b/docs/reference/classic_rock_raw_data.html index 7ea8664..b61462e 100644 --- a/docs/reference/classic_rock_raw_data.html +++ b/docs/reference/classic_rock_raw_data.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -169,7 +172,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/classic_rock_song_list.html b/docs/reference/classic_rock_song_list.html index 3f7fad4..1020f5e 100644 --- a/docs/reference/classic_rock_song_list.html +++ b/docs/reference/classic_rock_song_list.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -169,7 +172,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/college_all_ages.html b/docs/reference/college_all_ages.html index 09251b1..50bf4a0 100644 --- a/docs/reference/college_all_ages.html +++ b/docs/reference/college_all_ages.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -138,7 +141,7 @@

    Formatemployed_fulltime_yearround

    Employed at least 50 weeks (WKW == 1) and at least 35 hours (WKHP >= 35)

    unemployed

    Number unemployed (ESR == 3)

    unemployment_rate

    Unemployed / (Unemployed + Employed)

    -
    p25th

    25th percentile of earnigns

    +
    p25th

    25th percentile of earnings

    median

    Median earnings of full-time, year-round workers

    p75th

    75th percentile of earnings

    @@ -173,7 +176,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/college_grad_students.html b/docs/reference/college_grad_students.html index d480545..04d7eae 100644 --- a/docs/reference/college_grad_students.html +++ b/docs/reference/college_grad_students.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -139,7 +142,7 @@

    Formatgrad_employed_fulltime_yearround

    Employed at least 50 weeks (WKW == 1) and at least 35 hours (WKHP >= 35)

    grad_unemployed

    Number unemployed (ESR == 3)

    grad_unemployment_rate

    Unemployed / (Unemployed + Employed)

    -
    grad_p25th

    25th percentile of earnigns

    +
    grad_p25th

    25th percentile of earnings

    grad_median

    Median earnings of full-time, year-round workers

    grad_p75th

    75th percentile of earnings

    nongrad_total

    Total number of people with major

    @@ -147,7 +150,7 @@

    Formatnongrad_employed_fulltime_yearround

    Employed at least 50 weeks (WKW == 1) and at least 35 hours (WKHP >= 35)

    nongrad_unemployed

    Number unemployed (ESR == 3)

    nongrad_unemployment_rate

    Unemployed / (Unemployed + Employed)

    -
    nongrad_p25th

    25th percentile of earnigns

    +
    nongrad_p25th

    25th percentile of earnings

    nongrad_median

    Median earnings of full-time, year-round workers

    nongrad_p75th

    75th percentile of earnings

    grad_share

    grad_total / (grad_total + nongrad_total)

    @@ -184,7 +187,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/college_recent_grads.html b/docs/reference/college_recent_grads.html index 25e06ae..0642428 100644 --- a/docs/reference/college_recent_grads.html +++ b/docs/reference/college_recent_grads.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -145,7 +148,7 @@

    Formatemployed_fulltime_yearround

    Employed at least 50 weeks (WKW == 1) and at least 35 hours (WKHP >= 35)

    unemployed

    Number unemployed (ESR == 3)

    unemployment_rate

    Unemployed / (Unemployed + Employed)

    -
    p25th

    25th percentile of earnigns

    +
    p25th

    25th percentile of earnings

    median

    Median earnings of full-time, year-round workers

    p75th

    75th percentile of earnings

    college_jobs

    Number with job requiring a college degree

    @@ -184,7 +187,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/comic_characters.html b/docs/reference/comic_characters.html index bec4524..264c2f4 100644 --- a/docs/reference/comic_characters.html +++ b/docs/reference/comic_characters.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -122,7 +125,9 @@

    Comic Books Are Still Made By Men, For Men And About Men

    The raw data behind the story "Comic Books Are Still Made By Men, For Men And About Men" -https://fivethirtyeight.com/features/women-in-comic-books/.

    +https://fivethirtyeight.com/features/women-in-comic-books/. +An analysis using this data was contributed by Jonathan Bouchet as a package vignette at +http://fivethirtyeight-r.netlify.com/articles/comics_gender.html.

    comic_characters
    @@ -176,7 +181,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/comma_survey.html b/docs/reference/comma_survey.html index f8e91b0..4897575 100644 --- a/docs/reference/comma_survey.html +++ b/docs/reference/comma_survey.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -147,7 +150,7 @@

    FormatSource

    -

    See https://github.com/fivethirtyeight/data/tree/master/comma-survey-data.

    +

    See https://github.com/fivethirtyeight/data/tree/master/comma-survey.

    @@ -169,7 +172,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/congress_age.html b/docs/reference/congress_age.html index c3c5535..3615524 100644 --- a/docs/reference/congress_age.html +++ b/docs/reference/congress_age.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -170,7 +173,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/cousin_marriage.html b/docs/reference/cousin_marriage.html index a460fcf..8ebd9dc 100644 --- a/docs/reference/cousin_marriage.html +++ b/docs/reference/cousin_marriage.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -158,7 +161,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/daily_show_guests.html b/docs/reference/daily_show_guests.html index dbe78aa..7d1ce69 100644 --- a/docs/reference/daily_show_guests.html +++ b/docs/reference/daily_show_guests.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -134,12 +137,12 @@

    Formatgoogle_knowledge_occupation

    Their occupation or office, according to Google's Knowledge Graph or, if they're not in there, how Stewart introduced them on the program.

    show

    Air date of episode. Not unique, as some shows had more than one guest

    group

    A larger group designation for the occupation. For instance, us senators, us presidents, and former presidents are all under "politicians"

    -
    raw_guest_list

    The person or list of people who appeared on the show, according to Wikipedia. The GoogleKnowlege_Occupation only refers to one of them in a given row.

    +
    raw_guest_list

    The person or list of people who appeared on the show, according to Wikipedia. The GoogleKnowledge_Occupation only refers to one of them in a given row.

    Source

    -

    Google Knowlege Graph, The Daily Show clip library, Wikipedia.

    +

    Google Knowledge Graph, The Daily Show clip library, Wikipedia.

    @@ -161,7 +164,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/democratic_bench.html b/docs/reference/democratic_bench.html index d49cfd3..2e89f39 100644 --- a/docs/reference/democratic_bench.html +++ b/docs/reference/democratic_bench.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -159,7 +162,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/drinks.html b/docs/reference/drinks.html index fdb15df..86b2cda 100644 --- a/docs/reference/drinks.html +++ b/docs/reference/drinks.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -139,7 +142,7 @@

    FormatSource

    -

    World Health Organisation, Global Information System on Alcohol and Health (GISAH), 2010.

    +

    World Health Organization, Global Information System on Alcohol and Health (GISAH), 2010.

    Examples

    @@ -173,7 +176,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/drug_use.html b/docs/reference/drug_use.html index 0b246df..6afb9e5 100644 --- a/docs/reference/drug_use.html +++ b/docs/reference/drug_use.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -202,7 +205,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/elo_blatter.html b/docs/reference/elo_blatter.html index 3139853..428e2c5 100644 --- a/docs/reference/elo_blatter.html +++ b/docs/reference/elo_blatter.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -164,7 +167,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/endorsements.html b/docs/reference/endorsements.html index b915c85..aeceeb0 100644 --- a/docs/reference/endorsements.html +++ b/docs/reference/endorsements.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -169,7 +172,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/fandango.html b/docs/reference/fandango.html index 066b47a..6160de4 100644 --- a/docs/reference/fandango.html +++ b/docs/reference/fandango.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -182,7 +185,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/fifa_audience.html b/docs/reference/fifa_audience.html index 213a9e9..9e6ac65 100644 --- a/docs/reference/fifa_audience.html +++ b/docs/reference/fifa_audience.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -171,7 +174,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/fivethirtyeight.html b/docs/reference/fivethirtyeight.html index f35832b..cb26d24 100644 --- a/docs/reference/fivethirtyeight.html +++ b/docs/reference/fivethirtyeight.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -133,19 +136,18 @@

    Examp
    # Example usage: library(fivethirtyeight) head(bechdel)
    #> # A tibble: 6 x 15 -#> year imdb title test clean_test binary budget -#> <int> <chr> <chr> <chr> <ord> <chr> <int> -#> 1 2013 tt1711425 21 & Over notalk notalk FAIL 13000000 -#> 2 2012 tt1343727 Dredd 3D ok-disagree ok PASS 45000000 -#> 3 2013 tt2024544 12 Years a Slave notalk-disagree notalk FAIL 20000000 -#> 4 2013 tt1272878 2 Guns notalk notalk FAIL 61000000 -#> 5 2013 tt0453562 42 men men FAIL 40000000 -#> 6 2013 tt1335975 47 Ronin men men FAIL 225000000 -#> # ... with 8 more variables: domgross <dbl>, intgross <dbl>, code <chr>, -#> # budget_2013 <int>, domgross_2013 <dbl>, intgross_2013 <dbl>, -#> # period_code <int>, decade_code <int>
    +#> year imdb title test clean_test binary budget domgross intgross code +#> <int> <chr> <chr> <chr> <ord> <chr> <int> <dbl> <dbl> <chr> +#> 1 2013 tt171… 21 & O… notalk notalk FAIL 1.30e⁷ 25682380 4.22e⁷ 2013… +#> 2 2012 tt134… Dredd … ok-dis… ok PASS 4.50e⁷ 13414714 4.09e⁷ 2012… +#> 3 2013 tt202… 12 Yea… notalk… notalk FAIL 2.00e⁷ 53107035 1.59e⁸ 2013… +#> 4 2013 tt127… 2 Guns notalk notalk FAIL 6.10e⁷ 75612460 1.32e⁸ 2013… +#> 5 2013 tt045… 42 men men FAIL 4.00e⁷ 95020213 9.50e⁷ 2013… +#> 6 2013 tt133… 47 Ron… men men FAIL 2.25e⁸ 38362475 1.46e⁸ 2013… +#> # ... with 5 more variables: budget_2013 <int>, domgross_2013 <dbl>, +#> # intgross_2013 <dbl>, period_code <int>, decade_code <int>
    # All information about any data set can be found in the help file: -?bechdel
    #> Rendering development documentation for 'bechdel'
    +?bechdel
    #> Using development documentation for bechdel
    # To view a list of all data sets: data(package = "fivethirtyeight") @@ -172,7 +174,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/flying.html b/docs/reference/flying.html index d578c5b..54876fe 100644 --- a/docs/reference/flying.html +++ b/docs/reference/flying.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -183,7 +186,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/food_world_cup.html b/docs/reference/food_world_cup.html index 71e1483..75e9af1 100644 --- a/docs/reference/food_world_cup.html +++ b/docs/reference/food_world_cup.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -213,7 +216,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/generic_polllist.html b/docs/reference/generic_polllist.html index d48376d..9a0348f 100644 --- a/docs/reference/generic_polllist.html +++ b/docs/reference/generic_polllist.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -183,7 +186,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/generic_topline.html b/docs/reference/generic_topline.html index f7734e5..f5fe6dd 100644 --- a/docs/reference/generic_topline.html +++ b/docs/reference/generic_topline.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -171,7 +174,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/google_trends.html b/docs/reference/google_trends.html index 1aa9147..fb9d075 100644 --- a/docs/reference/google_trends.html +++ b/docs/reference/google_trends.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -176,7 +179,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/goose.html b/docs/reference/goose.html index 0bf1264..4822638 100644 --- a/docs/reference/goose.html +++ b/docs/reference/goose.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -139,7 +142,7 @@

    Formatmehs

    Mehs

    league_average_gpct

    League-average goose percentage

    ppf

    Pitcher park factor

    -
    replacement_gpct

    Replacement-level goose pecentage

    +
    replacement_gpct

    Replacement-level goose percentage

    gwar

    Goose Wins Above Replacement

    key_retro

    Retrosheet unique player identifier

    @@ -168,7 +171,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/hate_crimes.html b/docs/reference/hate_crimes.html index 8d3e717..c6ffb58 100644 --- a/docs/reference/hate_crimes.html +++ b/docs/reference/hate_crimes.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -168,7 +171,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/hiphop_cand_lyrics.html b/docs/reference/hiphop_cand_lyrics.html index a4b1800..e53511a 100644 --- a/docs/reference/hiphop_cand_lyrics.html +++ b/docs/reference/hiphop_cand_lyrics.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -164,7 +167,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/hist_ncaa_bball_casts.html b/docs/reference/hist_ncaa_bball_casts.html index 26eec94..bb5edaf 100644 --- a/docs/reference/hist_ncaa_bball_casts.html +++ b/docs/reference/hist_ncaa_bball_casts.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -162,7 +165,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/hist_senate_preds.html b/docs/reference/hist_senate_preds.html index dd9c101..d10766f 100644 --- a/docs/reference/hist_senate_preds.html +++ b/docs/reference/hist_senate_preds.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -161,7 +164,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/index.html b/docs/reference/index.html index 93d63b4..aeb0263 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -118,7 +121,7 @@ @@ -806,7 +809,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/librarians.html b/docs/reference/librarians.html index 64c88a2..3225719 100644 --- a/docs/reference/librarians.html +++ b/docs/reference/librarians.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -165,7 +168,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/love_actually_adj.html b/docs/reference/love_actually_adj.html index cf565b6..6f7c6b5 100644 --- a/docs/reference/love_actually_adj.html +++ b/docs/reference/love_actually_adj.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -172,7 +175,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/love_actually_appearance.html b/docs/reference/love_actually_appearance.html index 92a0223..a1f5984 100644 --- a/docs/reference/love_actually_appearance.html +++ b/docs/reference/love_actually_appearance.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -181,7 +184,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/mad_men.html b/docs/reference/mad_men.html index 2487736..6ca31fd 100644 --- a/docs/reference/mad_men.html +++ b/docs/reference/mad_men.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -171,7 +174,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/male_flight_attend.html b/docs/reference/male_flight_attend.html index 713de6f..d992f33 100644 --- a/docs/reference/male_flight_attend.html +++ b/docs/reference/male_flight_attend.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -158,7 +161,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/mayweather_mcgregor_tweets.html b/docs/reference/mayweather_mcgregor_tweets.html index 335463d..d5e3937 100644 --- a/docs/reference/mayweather_mcgregor_tweets.html +++ b/docs/reference/mayweather_mcgregor_tweets.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -129,7 +132,9 @@

    Mayweather Vs McGregor Tweets

    Format

    -

    A data frame with 12118 rows representing tweets and 7 variables:

    +

    Because of R package size restrictions, only a preview of the +first 10 rows of this dataset is included; to obtain the entire dataset +(12118 rows) see Examples below. A data frame with 10 rows representing tweets and 7 variables:

    created_at

    Time and date at which the tweet associated with the Mayweather vs. McGregor fight was sent.

    emojis

    Whether or not emojis were used in the tweet about the fight.

    id

    A numerical identifier for each individual tweet about the fight.

    @@ -148,6 +153,19 @@

    Sourcehttps://github.com/fivethirtyeight/data/tree/master/mayweather-mcgregor

    +

    Examples

    +
    # To obtain the entire dataset, run the code inside the following if statement: +if(FALSE){ + library(tidyverse) + url <- + "https://raw.githubusercontent.com/fivethirtyeight/data/master/mayweather-mcgregor/tweets.csv" + mayweather_mcgregor_tweets <- read_csv(url) %>% + mutate( + emojis = as.logical(emojis), + retweeted = as.logical(retweeted), + id = as.character(id) + ) +}
    @@ -167,7 +187,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/mediacloud_hurricanes.html b/docs/reference/mediacloud_hurricanes.html index 7446aab..61f01fb 100644 --- a/docs/reference/mediacloud_hurricanes.html +++ b/docs/reference/mediacloud_hurricanes.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -170,7 +173,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/mediacloud_online_news.html b/docs/reference/mediacloud_online_news.html index f265151..3a0c5fb 100644 --- a/docs/reference/mediacloud_online_news.html +++ b/docs/reference/mediacloud_online_news.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -167,7 +170,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/mediacloud_states.html b/docs/reference/mediacloud_states.html index 077dcd0..a8fc130 100644 --- a/docs/reference/mediacloud_states.html +++ b/docs/reference/mediacloud_states.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -169,7 +172,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/mediacloud_trump.html b/docs/reference/mediacloud_trump.html index 291ea0c..bc2ad93 100644 --- a/docs/reference/mediacloud_trump.html +++ b/docs/reference/mediacloud_trump.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -172,7 +175,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/mlb_as_play_talent.html b/docs/reference/mlb_as_play_talent.html index 7e1a17a..2a98ca0 100644 --- a/docs/reference/mlb_as_play_talent.html +++ b/docs/reference/mlb_as_play_talent.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -135,7 +138,7 @@

    Formatgamenum

    Order of All-Star Game for the season (in years w/ multiple ASGs; set to 0 when only 1 per year)

    gameid

    Game ID at Baseball-Reference.com

    lgid

    League of All-Star team

    -
    startingpos

    Postion (according to baseball convention; 1=pitcher, 2=catcher, etc.) if starter

    +
    startingpos

    Position (according to baseball convention; 1=pitcher, 2=catcher, etc.) if starter

    off600

    Estimate of offensive talent, in runs above league average per 600 plate appearances

    def600

    Estimate of fielding talent, in runs above league average per 600 plate appearances

    pitch200

    Estimate of pitching talent, in runs above league average per 200 innings pitched

    @@ -171,7 +174,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/mlb_as_team_talent.html b/docs/reference/mlb_as_team_talent.html index d1123d8..675471f 100644 --- a/docs/reference/mlb_as_team_talent.html +++ b/docs/reference/mlb_as_team_talent.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -172,7 +175,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/mlb_elo.html b/docs/reference/mlb_elo.html index 9c731ed..1d06e93 100644 --- a/docs/reference/mlb_elo.html +++ b/docs/reference/mlb_elo.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -198,7 +201,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/murder_2015_final.html b/docs/reference/murder_2015_final.html index f3285b0..d934337 100644 --- a/docs/reference/murder_2015_final.html +++ b/docs/reference/murder_2015_final.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -161,7 +164,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/murder_2016_prelim.html b/docs/reference/murder_2016_prelim.html index 975dcc9..e71f94b 100644 --- a/docs/reference/murder_2016_prelim.html +++ b/docs/reference/murder_2016_prelim.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -163,7 +166,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/nba_carmelo.html b/docs/reference/nba_carmelo.html index 9c92f86..8bef590 100644 --- a/docs/reference/nba_carmelo.html +++ b/docs/reference/nba_carmelo.html @@ -92,6 +92,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -211,7 +214,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/nba_draft_2015.html b/docs/reference/nba_draft_2015.html index fa3e85b..7abd956 100644 --- a/docs/reference/nba_draft_2015.html +++ b/docs/reference/nba_draft_2015.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -122,7 +125,9 @@

    Projecting The Top 50 Players In The 2015 NBA Draft Class

    The raw data behind the story "Projecting The Top 50 Players In The 2015 NBA Draft Class" -https://fivethirtyeight.com/features/projecting-the-top-50-players-in-the-2015-nba-draft-class/.

    +https://fivethirtyeight.com/features/projecting-the-top-50-players-in-the-2015-nba-draft-class/. +An analysis using this data was contributed by G. Elliott Morris as a package vignette at +http://fivethirtyeight-r.netlify.com/articles/nba.html.

    nba_draft_2015
    @@ -165,7 +170,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/nba_tattoos.html b/docs/reference/nba_tattoos.html index f3c3a75..d69f006 100644 --- a/docs/reference/nba_tattoos.html +++ b/docs/reference/nba_tattoos.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -158,7 +161,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/nfl_elo.html b/docs/reference/nfl_elo.html index cd51cf6..b344d9e 100644 --- a/docs/reference/nfl_elo.html +++ b/docs/reference/nfl_elo.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -131,7 +134,10 @@

    The Complete History Of The NFL 2017 NFL Predictions

    Format

    -

    a data frame with 16,007 rows representing games and 14 variables:

    +

    Because of R package size restrictions, only a preview of the +first 10 rows of this dataset is included; to obtain the entire dataset +(1920 to 2018 games) see Examples below. A data frame with 10 rows +representing games and 14 variables:

    date

    Date

    season

    Season year, 1920-2018

    neutral

    TRUE if the game was played on neutral territory, FALSE if not

    @@ -150,7 +156,16 @@

    FormatSource

    -

    See https://projects.fivethirtyeight.com/nfl-api/nfl_elo.csv

    +

    See https://projects.fivethirtyeight.com/nfl-api/nfl_elo.csv +# To obtain the entire dataset, run the following code: +library(tidyverse) +library(janitor) +nfl_elo <- read_csv("https://projects.fivethirtyeight.com/nfl-api/nfl_elo.csv") + clean_names() + mutate( + team1 = as.factor(team1), + team2 = as.factor(team2), + neutral = ifelse(neutral == 1, TRUE, FALSE))

    @@ -172,7 +187,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/nfl_fandom_google.html b/docs/reference/nfl_fandom_google.html index c825988..158d401 100644 --- a/docs/reference/nfl_fandom_google.html +++ b/docs/reference/nfl_fandom_google.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -178,7 +181,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/nfl_fandom_surveymonkey.html b/docs/reference/nfl_fandom_surveymonkey.html index b7c7ac8..bbf53af 100644 --- a/docs/reference/nfl_fandom_surveymonkey.html +++ b/docs/reference/nfl_fandom_surveymonkey.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -132,29 +135,29 @@

    Formata data frame with 33 rows representing teams and 25 variables:

    team

    NFL team

    total_respondents

    Total number of poll respondents who ranked the given team in their top 3 favorites

    -
    asian_dem

    Number of asian, democrat poll respondents who ranked the given team in their top 3 favorites

    -
    black_dem

    Number of black, democrat poll respondents who ranked the given team in their top 3 favorites

    -
    hispanic_dem

    Number of hispanic, democrat poll respondents who ranked the given team in their top 3 favorites

    -
    other_dem

    Number of democrat poll respondents who identified their race as "other" (not asian, black, hispanic, or white) and ranked the given team in their top 3 favorites

    -
    white_dem

    Number of white, democrat poll respondents who ranked the given team in their top 3 favorites

    +
    asian_dem

    Number of Asian, democrat poll respondents who ranked the given team in their top 3 favorites

    +
    black_dem

    Number of Black, democrat poll respondents who ranked the given team in their top 3 favorites

    +
    hispanic_dem

    Number of Hispanic, democrat poll respondents who ranked the given team in their top 3 favorites

    +
    other_dem

    Number of democrat poll respondents who identified their race as "other" (not Asian, Black, Hispanic, or White) and ranked the given team in their top 3 favorites

    +
    white_dem

    Number of White, democrat poll respondents who ranked the given team in their top 3 favorites

    total_dem

    Total number of democrat poll respondents who ranked the given team in their top 3 favorites

    -
    asian_ind

    Number of asian, independent poll respondents who ranked the given team in their top 3 favorites

    -
    black_ind

    Number of black, independent poll respondents who ranked the given team in their top 3 favorites

    -
    hispanic_ind

    Number of hispanic, independent poll respondents who ranked the given team in their top 3 favorites

    -
    other_ind

    Number of independent poll respondents who identified their race as "other" (not asian, black, hispanic, or white) and ranked the given team in their top 3 favorites

    -
    white_ind

    Number of white, independent poll respondents who ranked the given team in their top 3 favorites

    +
    asian_ind

    Number of Asian, independent poll respondents who ranked the given team in their top 3 favorites

    +
    black_ind

    Number of Black, independent poll respondents who ranked the given team in their top 3 favorites

    +
    hispanic_ind

    Number of Hispanic, independent poll respondents who ranked the given team in their top 3 favorites

    +
    other_ind

    Number of independent poll respondents who identified their race as "other" (not Asian, Black, Hispanic, or White) and ranked the given team in their top 3 favorites

    +
    white_ind

    Number of White, independent poll respondents who ranked the given team in their top 3 favorites

    total_ind

    Total number of independent poll respondents who ranked the given team in their top 3 favorites

    -
    asian_gop

    Number of asian, republican poll respondents who ranked the given team in their top 3 favorites

    -
    black_gop

    Number of black, republican poll respondents who ranked the given team in their top 3 favorites

    -
    hispanic_gop

    Number of hispanic, republican poll respondents who ranked the given team in their top 3 favorites

    -
    other_gop

    Number of republican poll respondents who identified their race as "other" (not asian, black, hispanic, or white) and ranked the given team in their top 3 favorites

    -
    white_gop

    Number of white, republican poll respondents who ranked the given team in their top 3 favorites

    +
    asian_gop

    Number of Asian, republican poll respondents who ranked the given team in their top 3 favorites

    +
    black_gop

    Number of Black, republican poll respondents who ranked the given team in their top 3 favorites

    +
    hispanic_gop

    Number of Hispanic, republican poll respondents who ranked the given team in their top 3 favorites

    +
    other_gop

    Number of republican poll respondents who identified their race as "other" (not Asian, Black, Hispanic, or White) and ranked the given team in their top 3 favorites

    +
    white_gop

    Number of White, republican poll respondents who ranked the given team in their top 3 favorites

    total_gop

    Total number of republican poll respondents who ranked the given team in their top 3 favorites

    gop_percent

    Percent of fans (who ranked the team in their top 3 favorite NFL teams) who are republicans

    dem_percent

    Percent of fans who are democrats

    ind_percent

    Percent of fans who are independent

    -
    white_percent

    Percent of fans who are white

    -
    nonwhite_percent

    Percent of fans who are not white

    +
    white_percent

    Percent of fans who are White

    +
    nonwhite_percent

    Percent of fans who are not White

    Source

    @@ -197,7 +200,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/nfl_fav_team.html b/docs/reference/nfl_fav_team.html index 950035f..6b7f38e 100644 --- a/docs/reference/nfl_fav_team.html +++ b/docs/reference/nfl_fav_team.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -173,7 +176,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/nfl_suspensions.html b/docs/reference/nfl_suspensions.html index 3729d54..0173936 100644 --- a/docs/reference/nfl_suspensions.html +++ b/docs/reference/nfl_suspensions.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -133,7 +136,7 @@

    Formatname

    first initial.last name

    team

    team at time of suspension

    games

    number of games suspended (one regular season = 16 games)

    -
    category

    personal conduct, substance abuse, peformance enhancing drugs or in-game violence

    +
    category

    personal conduct, substance abuse, performance enhancing drugs or in-game violence

    description

    description of suspension

    year

    year of suspension

    source

    news source

    @@ -163,7 +166,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/nfltix_div_avgprice.html b/docs/reference/nfltix_div_avgprice.html index 469de49..a566834 100644 --- a/docs/reference/nfltix_div_avgprice.html +++ b/docs/reference/nfltix_div_avgprice.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -159,7 +162,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/nfltix_usa_avg.html b/docs/reference/nfltix_usa_avg.html index 1f651aa..75d0f58 100644 --- a/docs/reference/nfltix_usa_avg.html +++ b/docs/reference/nfltix_usa_avg.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -158,7 +161,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/nflwr_aging_curve.html b/docs/reference/nflwr_aging_curve.html index 7605e7a..f160bce 100644 --- a/docs/reference/nflwr_aging_curve.html +++ b/docs/reference/nflwr_aging_curve.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -159,7 +162,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/nflwr_hist.html b/docs/reference/nflwr_hist.html index 2d03249..4e43ee3 100644 --- a/docs/reference/nflwr_hist.html +++ b/docs/reference/nflwr_hist.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -162,7 +165,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/nutrition_pvalues.html b/docs/reference/nutrition_pvalues.html index cfde773..5ae9ca3 100644 --- a/docs/reference/nutrition_pvalues.html +++ b/docs/reference/nutrition_pvalues.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -159,7 +162,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/police_deaths.html b/docs/reference/police_deaths.html index ecd9069..afaa231 100644 --- a/docs/reference/police_deaths.html +++ b/docs/reference/police_deaths.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -163,7 +166,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/police_killings.html b/docs/reference/police_killings.html index aa192a3..412cdcd 100644 --- a/docs/reference/police_killings.html +++ b/docs/reference/police_killings.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -190,7 +193,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/police_locals.html b/docs/reference/police_locals.html index e9000bd..8334f19 100644 --- a/docs/reference/police_locals.html +++ b/docs/reference/police_locals.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -183,7 +186,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/pres_2016_trail.html b/docs/reference/pres_2016_trail.html index 75b9645..692fef6 100644 --- a/docs/reference/pres_2016_trail.html +++ b/docs/reference/pres_2016_trail.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -161,7 +164,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/pres_commencement.html b/docs/reference/pres_commencement.html index ad327a4..0882d27 100644 --- a/docs/reference/pres_commencement.html +++ b/docs/reference/pres_commencement.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -164,7 +167,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/pulitzer.html b/docs/reference/pulitzer.html index f985482..a2006ae 100644 --- a/docs/reference/pulitzer.html +++ b/docs/reference/pulitzer.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -163,7 +166,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/ratings.html b/docs/reference/ratings.html index 007a7b8..2e666e8 100644 --- a/docs/reference/ratings.html +++ b/docs/reference/ratings.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -121,7 +124,7 @@

    An Inconvenient Sequel

    The raw data behind the story -"Al Gore’s New Movie Exposes The Big Flaw In Online Movie Ratings" +"Al Gore's New Movie Exposes The Big Flaw In Online Movie Ratings" https://fivethirtyeight.com/features/al-gores-new-movie-exposes-the-big-flaw-in-online-movie-ratings/.

    @@ -193,7 +196,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/riddler_castles.html b/docs/reference/riddler_castles.html index 66de271..9080fbc 100644 --- a/docs/reference/riddler_castles.html +++ b/docs/reference/riddler_castles.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -183,7 +186,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/riddler_castles2.html b/docs/reference/riddler_castles2.html index d4fe810..9c2d694 100644 --- a/docs/reference/riddler_castles2.html +++ b/docs/reference/riddler_castles2.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -183,7 +186,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/riddler_pick_lowest.html b/docs/reference/riddler_pick_lowest.html index d0acebf..f779c58 100644 --- a/docs/reference/riddler_pick_lowest.html +++ b/docs/reference/riddler_pick_lowest.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -152,7 +155,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/san_andreas.html b/docs/reference/san_andreas.html index 23d59ff..cb57be6 100644 --- a/docs/reference/san_andreas.html +++ b/docs/reference/san_andreas.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -167,7 +170,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/sandy_311.html b/docs/reference/sandy_311.html index 8e637f7..b61b6e5 100644 --- a/docs/reference/sandy_311.html +++ b/docs/reference/sandy_311.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -193,7 +196,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/senate_polls.html b/docs/reference/senate_polls.html index 08b9069..1db7732 100644 --- a/docs/reference/senate_polls.html +++ b/docs/reference/senate_polls.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -160,7 +163,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/senators.html b/docs/reference/senators.html index 72d21ad..35a2615 100644 --- a/docs/reference/senators.html +++ b/docs/reference/senators.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -194,7 +197,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/spi_global_rankings.html b/docs/reference/spi_global_rankings.html index 75fa495..8a6d86e 100644 --- a/docs/reference/spi_global_rankings.html +++ b/docs/reference/spi_global_rankings.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -170,7 +173,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/spi_matches.html b/docs/reference/spi_matches.html index 8ea1e39..e659585 100644 --- a/docs/reference/spi_matches.html +++ b/docs/reference/spi_matches.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -181,7 +184,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/steak_survey.html b/docs/reference/steak_survey.html index b27ed1a..68f3a57 100644 --- a/docs/reference/steak_survey.html +++ b/docs/reference/steak_survey.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -171,7 +174,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/tarantino.html b/docs/reference/tarantino.html index 6c15d63..6cec40e 100644 --- a/docs/reference/tarantino.html +++ b/docs/reference/tarantino.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -122,7 +125,10 @@

    A Complete Catalog Of Every Time Someone Cursed Or Bled Out In A Quentin Tar

    The raw data behind the story "A Complete Catalog Of Every Time Someone Cursed Or Bled Out In A Quentin Tarantino Movie" -https://fivethirtyeight.com/features/complete-catalog-curses-deaths-quentin-tarantino-films/.

    +https://fivethirtyeight.com/features/complete-catalog-curses-deaths-quentin-tarantino-films/. +An analysis using this data was contributed by Olivia Barrows, Jojo Miller, and Jayla Nakayama +as a package vignette at +http://fivethirtyeight-r.netlify.com/articles/tarantino_swears.html.

    tarantino
    @@ -160,7 +166,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/tennis_events_time.html b/docs/reference/tennis_events_time.html index 2697e0c..7fab6e3 100644 --- a/docs/reference/tennis_events_time.html +++ b/docs/reference/tennis_events_time.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -167,7 +170,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/tennis_players_time.html b/docs/reference/tennis_players_time.html index fda4a83..426285a 100644 --- a/docs/reference/tennis_players_time.html +++ b/docs/reference/tennis_players_time.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -164,7 +167,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/tennis_serve_time.html b/docs/reference/tennis_serve_time.html index 3af387a..8a81e40 100644 --- a/docs/reference/tennis_serve_time.html +++ b/docs/reference/tennis_serve_time.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -169,7 +172,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/tenth_circuit.html b/docs/reference/tenth_circuit.html index 1a0db9f..50a841e 100644 --- a/docs/reference/tenth_circuit.html +++ b/docs/reference/tenth_circuit.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -175,7 +178,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/trump_approval_poll.html b/docs/reference/trump_approval_poll.html index 13b523e..b9ec01b 100644 --- a/docs/reference/trump_approval_poll.html +++ b/docs/reference/trump_approval_poll.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -140,8 +143,8 @@

    Formatweight

    The weight fivethirtyeight gives the poll when determining approval ratings based on historical accuracy of the pollster

    approve

    The percentage of respondents who approve of the president

    disapprove

    The percentage of respondents who disapprove of the president

    -
    adjusted_approve

    The percentage of respondets who approve of the president adjusted for systematic tendencies of the polling firm

    -
    adjusted_disapprove

    The percentage of respondets who approve of the president adjusted for systematic tendencies of the polling firm

    +
    adjusted_approve

    The percentage of respondents who approve of the president adjusted for systematic tendencies of the polling firm

    +
    adjusted_disapprove

    The percentage of respondents who approve of the president adjusted for systematic tendencies of the polling firm

    multiversions

    True if there are multiple versions of the poll, False if there are not

    tracking

    TRUE if the poll was tracked, FALSE if not

    url

    Poll result URL

    @@ -189,7 +192,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/trump_approval_trend.html b/docs/reference/trump_approval_trend.html index 2fe8f6d..f612101 100644 --- a/docs/reference/trump_approval_trend.html +++ b/docs/reference/trump_approval_trend.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -177,7 +180,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/trump_news.html b/docs/reference/trump_news.html index e25d79c..6aed76a 100644 --- a/docs/reference/trump_news.html +++ b/docs/reference/trump_news.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -159,7 +162,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/trump_twitter.html b/docs/reference/trump_twitter.html index 947a177..afeec07 100644 --- a/docs/reference/trump_twitter.html +++ b/docs/reference/trump_twitter.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -123,7 +126,9 @@

    The World's Favorite Donald Trump Tweets

    The raw data behind the story "The World's Favorite Donald Trump Tweets" https://fivethirtyeight.com/features/the-worlds-favorite-donald-trump-tweets/. -Tweets posted on twitter by Donald Trump (@realDonaldTrump)

    +Tweets posted on twitter by Donald Trump (@realDonaldTrump). +An analysis using this data was contributed by Adam Spannbauer as a package vignette at +http://fivethirtyeight-r.netlify.com/articles/trump_twitter.html.

    trump_twitter
    @@ -160,7 +165,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/trumpworld_issues.html b/docs/reference/trumpworld_issues.html index c4a04a3..fb45213 100644 --- a/docs/reference/trumpworld_issues.html +++ b/docs/reference/trumpworld_issues.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -174,7 +177,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/trumpworld_polls.html b/docs/reference/trumpworld_polls.html index ea6e775..dafa5d0 100644 --- a/docs/reference/trumpworld_polls.html +++ b/docs/reference/trumpworld_polls.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -130,7 +133,7 @@

    What the World Thinks of Trump

    Format

    -

    A data frame with 32 rows representng years and 40 variables:

    +

    A data frame with 32 rows representing years and 40 variables:

    year

    Year the poll was conducted

    avg

    The average percentage people who answered the poll question positively (support the president or have a favorable view of the U.S.)

    canada

    The percentage of people from Canada who answered the poll question positively

    @@ -152,7 +155,7 @@

    Formatphilippines

    The percentage of people from the Philippines who answered the poll question positively

    south_korea

    The percentage of people from South Korea who answered the poll question positively

    vietnam

    The percentage of people from Vietnam who answered the poll question positively

    -
    israel

    The percentage of people from Isreal who answered the poll question positively

    +
    israel

    The percentage of people from Israel who answered the poll question positively

    jordan

    The percentage of people from Jordan who answered the poll question positively

    lebanon

    The percentage of people from Lebanon who answered the poll question positively

    tunisia

    The percentage of people from Tunisia who answered the poll question positively

    @@ -170,7 +173,7 @@

    Formatmexico

    The percentage of people from Mexico who answered the poll question positively

    peru

    The percentage of people from Peru who answered the poll question positively

    venezuela

    The percentage of people from Venezuela who answered the poll question positively

    -
    question

    The item being polled. Specificially, whether respondents: 1) Have a favorable view of the U.S. or 2) Trust the U.S. President when it comes to foreign affairs

    +
    question

    The item being polled. Specifically, whether respondents: 1) Have a favorable view of the U.S. or 2) Trust the U.S. President when it comes to foreign affairs

    Source

    @@ -210,7 +213,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/tv_hurricanes.html b/docs/reference/tv_hurricanes.html index e8f897e..51879ca 100644 --- a/docs/reference/tv_hurricanes.html +++ b/docs/reference/tv_hurricanes.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -171,7 +174,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/tv_hurricanes_by_network.html b/docs/reference/tv_hurricanes_by_network.html index de7b335..56cc7aa 100644 --- a/docs/reference/tv_hurricanes_by_network.html +++ b/docs/reference/tv_hurricanes_by_network.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -171,7 +174,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/tv_states.html b/docs/reference/tv_states.html index 23661a7..0f4daa4 100644 --- a/docs/reference/tv_states.html +++ b/docs/reference/tv_states.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -169,7 +172,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/twitter_presidents.html b/docs/reference/twitter_presidents.html index 1c4d947..55dbf3a 100644 --- a/docs/reference/twitter_presidents.html +++ b/docs/reference/twitter_presidents.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -176,7 +179,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/undefeated.html b/docs/reference/undefeated.html index 3209ffa..3190384 100644 --- a/docs/reference/undefeated.html +++ b/docs/reference/undefeated.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -160,7 +163,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/unisex_names.html b/docs/reference/unisex_names.html index 1dd5e64..bfc7e48 100644 --- a/docs/reference/unisex_names.html +++ b/docs/reference/unisex_names.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -161,7 +164,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/docs/reference/weather_check.html b/docs/reference/weather_check.html index 9c1aceb..b6fd239 100644 --- a/docs/reference/weather_check.html +++ b/docs/reference/weather_check.html @@ -91,6 +91,9 @@
  • Trump Twitter analysis using the `tidyverse`
  • +
  • + User-Contributed Vignettes +
  • @@ -165,7 +168,7 @@

    Contents

    -

    Site built with pkgdown.

    +

    Site built with pkgdown.

    diff --git a/man/ahca_polls.Rd b/man/ahca_polls.Rd index 6842d09..1987a1a 100644 --- a/man/ahca_polls.Rd +++ b/man/ahca_polls.Rd @@ -10,7 +10,7 @@ \item{end}{End date of the poll.} \item{pollster}{The entity that conducts and collects information from the poll.} \item{favor}{The number of affirmative responses to the question at the pollster.} - \item{oppose}{The number of negative reponses to the question at the pollster.} + \item{oppose}{The number of negative responses to the question at the pollster.} \item{url}{The website associated with the polling question.} \item{text}{The polling question asked at the pollster.} }} diff --git a/man/bachelorette.Rd b/man/bachelorette.Rd index d228164..df8019e 100644 --- a/man/bachelorette.Rd +++ b/man/bachelorette.Rd @@ -39,21 +39,21 @@ bachelorette } \description{ The raw data behind the stories: -"How To Spot A Front-Runner On The ‘Bachelor’ Or ‘Bachelorette’" -\url{https://fivethirtyeight.com/features/the-bachelorette/}, "Rachel’s Season Is Fitting Neatly Into ‘Bachelorette’ History" -\url{https://fivethirtyeight.com/features/rachels-season-is-fitting-neatly-into-bachelorette-history/}, and "Rachel Lindsay’s ‘Bachelorette’ Season, In Three Charts" +"How To Spot A Front-Runner On The 'Bachelor' Or 'Bachelorette'" +\url{https://fivethirtyeight.com/features/the-bachelorette/}, "Rachel's Season Is Fitting Neatly Into 'Bachelorette' History" +\url{https://fivethirtyeight.com/features/rachels-season-is-fitting-neatly-into-bachelorette-history/}, and "Rachel Lindsay's 'Bachelorette' Season, In Three Charts" \url{https://fivethirtyeight.com/features/rachel-lindsays-bachelorette-season-in-three-charts/}. } \details{ Eliminates connote either an elimination (starts with "E") or a rose -(starts with "R"). Eliminations supercede roses. "E" connotes a standard +(starts with "R"). Eliminations supersede roses. "E" connotes a standard elimination, typically at a rose ceremony. "EQ" means the contestant quits. "EF" means the contestant was fired by production. "ED" connotes a date elimination. "EU" connotes an unscheduled elimination, one that takes place at a time outside of a date or rose ceremony. "R" means the contestant received a rose. "R1" means the contestant got a first impression rose. "D1" means a one-on-one date, "D2" means a 2-on-1, "D3" means a 3-on-1 -group date, and so on. Weeks of the show are deliminated by rose +group date, and so on. Weeks of the show are eliminated by rose ceremonies, and may not line up exactly with episodes. } \keyword{datasets} diff --git a/man/biopics.Rd b/man/biopics.Rd index 391dd9e..776070e 100644 --- a/man/biopics.Rd +++ b/man/biopics.Rd @@ -31,5 +31,7 @@ biopics The raw data behind the story "'Straight Outta Compton' Is The Rare Biopic Not About White Dudes" \url{https://fivethirtyeight.com/features/straight-outta-compton-is-the-rare-biopic-not-about-white-dudes/}. +An analysis using this data was contributed by Pradeep Adhokshaja as a package vignette at +\url{http://fivethirtyeight-r.netlify.com/articles/biopics.html}. } \keyword{datasets} diff --git a/man/bob_ross.Rd b/man/bob_ross.Rd index 49bdc75..5326a15 100644 --- a/man/bob_ross.Rd +++ b/man/bob_ross.Rd @@ -88,6 +88,8 @@ bob_ross The raw data behind the story "A Statistical Analysis of the Work of Bob Ross" \url{https://fivethirtyeight.com/features/a-statistical-analysis-of-the-work-of-bob-ross/}. +An analysis using this data was contributed by Jonathan Bouchet as a package vignette at +\url{http://fivethirtyeight-r.netlify.com/articles/bob_ross.html}. } \examples{ # To convert data frame to tidy data (long) format, run: diff --git a/man/chess_transfers.Rd b/man/chess_transfers.Rd index 4329c33..9db9f6a 100644 --- a/man/chess_transfers.Rd +++ b/man/chess_transfers.Rd @@ -7,9 +7,9 @@ \format{A data frame with 932 rows representing international player transfers and 5 variables: \describe{ \item{url}{The corresponding website on the World Chess Federation page which details the transfers of a given year.} - \item{id}{An numeric identifier for the chess player who transfered.} + \item{id}{An numeric identifier for the chess player who transferred.} \item{federation}{The current national federation of the chess player} - \item{form_fed}{The national federation from which the chress player has transfered.} + \item{form_fed}{The national federation from which the chess player has transferred.} \item{transfer_date}{The date at which the transfer took place.} }} \source{ diff --git a/man/college_all_ages.Rd b/man/college_all_ages.Rd index bc3fff1..1da5a10 100644 --- a/man/college_all_ages.Rd +++ b/man/college_all_ages.Rd @@ -14,7 +14,7 @@ \item{employed_fulltime_yearround}{Employed at least 50 weeks (WKW == 1) and at least 35 hours (WKHP >= 35)} \item{unemployed}{Number unemployed (ESR == 3)} \item{unemployment_rate}{Unemployed / (Unemployed + Employed)} - \item{p25th}{25th percentile of earnigns} + \item{p25th}{25th percentile of earnings} \item{median}{Median earnings of full-time, year-round workers} \item{p75th}{75th percentile of earnings} }} diff --git a/man/college_grad_students.Rd b/man/college_grad_students.Rd index 7f8274f..9a1d2fd 100644 --- a/man/college_grad_students.Rd +++ b/man/college_grad_students.Rd @@ -15,7 +15,7 @@ \item{grad_employed_fulltime_yearround}{Employed at least 50 weeks (WKW == 1) and at least 35 hours (WKHP >= 35)} \item{grad_unemployed}{Number unemployed (ESR == 3)} \item{grad_unemployment_rate}{Unemployed / (Unemployed + Employed)} - \item{grad_p25th}{25th percentile of earnigns} + \item{grad_p25th}{25th percentile of earnings} \item{grad_median}{Median earnings of full-time, year-round workers} \item{grad_p75th}{75th percentile of earnings} \item{nongrad_total}{Total number of people with major} @@ -23,7 +23,7 @@ \item{nongrad_employed_fulltime_yearround}{Employed at least 50 weeks (WKW == 1) and at least 35 hours (WKHP >= 35)} \item{nongrad_unemployed}{Number unemployed (ESR == 3)} \item{nongrad_unemployment_rate}{Unemployed / (Unemployed + Employed)} - \item{nongrad_p25th}{25th percentile of earnigns} + \item{nongrad_p25th}{25th percentile of earnings} \item{nongrad_median}{Median earnings of full-time, year-round workers} \item{nongrad_p75th}{75th percentile of earnings} \item{grad_share}{grad_total / (grad_total + nongrad_total)} diff --git a/man/college_recent_grads.Rd b/man/college_recent_grads.Rd index b446340..03d6ecb 100644 --- a/man/college_recent_grads.Rd +++ b/man/college_recent_grads.Rd @@ -21,7 +21,7 @@ \item{employed_fulltime_yearround}{Employed at least 50 weeks (WKW == 1) and at least 35 hours (WKHP >= 35)} \item{unemployed}{Number unemployed (ESR == 3)} \item{unemployment_rate}{Unemployed / (Unemployed + Employed)} - \item{p25th}{25th percentile of earnigns} + \item{p25th}{25th percentile of earnings} \item{median}{Median earnings of full-time, year-round workers} \item{p75th}{75th percentile of earnings} \item{college_jobs}{Number with job requiring a college degree} diff --git a/man/comic_characters.Rd b/man/comic_characters.Rd index 50ea332..f1e3c58 100644 --- a/man/comic_characters.Rd +++ b/man/comic_characters.Rd @@ -37,5 +37,7 @@ comic_characters The raw data behind the story "Comic Books Are Still Made By Men, For Men And About Men" \url{https://fivethirtyeight.com/features/women-in-comic-books/}. +An analysis using this data was contributed by Jonathan Bouchet as a package vignette at +\url{http://fivethirtyeight-r.netlify.com/articles/comics_gender.html}. } \keyword{datasets} diff --git a/man/comma_survey.Rd b/man/comma_survey.Rd index eb930f9..8f6c1ea 100644 --- a/man/comma_survey.Rd +++ b/man/comma_survey.Rd @@ -21,7 +21,7 @@ \item{care_proper_grammar}{In your opinion, how important or unimportant is proper use of grammar?} }} \source{ -See \url{https://github.com/fivethirtyeight/data/tree/master/comma-survey-data}. +See \url{https://github.com/fivethirtyeight/data/tree/master/comma-survey}. } \usage{ comma_survey diff --git a/man/daily_show_guests.Rd b/man/daily_show_guests.Rd index fbdcbfb..ecff2c4 100644 --- a/man/daily_show_guests.Rd +++ b/man/daily_show_guests.Rd @@ -10,10 +10,10 @@ \item{google_knowledge_occupation}{Their occupation or office, according to Google's Knowledge Graph or, if they're not in there, how Stewart introduced them on the program.} \item{show}{Air date of episode. Not unique, as some shows had more than one guest} \item{group}{A larger group designation for the occupation. For instance, us senators, us presidents, and former presidents are all under "politicians"} - \item{raw_guest_list}{The person or list of people who appeared on the show, according to Wikipedia. The GoogleKnowlege_Occupation only refers to one of them in a given row.} + \item{raw_guest_list}{The person or list of people who appeared on the show, according to Wikipedia. The GoogleKnowledge_Occupation only refers to one of them in a given row.} }} \source{ -Google Knowlege Graph, The Daily Show clip library, Wikipedia. +Google Knowledge Graph, The Daily Show clip library, Wikipedia. } \usage{ daily_show_guests diff --git a/man/drinks.Rd b/man/drinks.Rd index 475cc82..c4de118 100644 --- a/man/drinks.Rd +++ b/man/drinks.Rd @@ -13,7 +13,7 @@ \item{total_litres_of_pure_alcohol}{Total litres of pure alcohol per person} }} \source{ -World Health Organisation, Global Information System on Alcohol and Health (GISAH), 2010. +World Health Organization, Global Information System on Alcohol and Health (GISAH), 2010. } \usage{ drinks diff --git a/man/goose.Rd b/man/goose.Rd index 4aced63..1450402 100644 --- a/man/goose.Rd +++ b/man/goose.Rd @@ -15,7 +15,7 @@ \item{mehs}{Mehs} \item{league_average_gpct}{League-average goose percentage} \item{ppf}{Pitcher park factor} - \item{replacement_gpct}{Replacement-level goose pecentage} + \item{replacement_gpct}{Replacement-level goose percentage} \item{gwar}{Goose Wins Above Replacement} \item{key_retro}{Retrosheet unique player identifier} }} diff --git a/man/mayweather_mcgregor_tweets.Rd b/man/mayweather_mcgregor_tweets.Rd index d57d13a..2d9a26b 100644 --- a/man/mayweather_mcgregor_tweets.Rd +++ b/man/mayweather_mcgregor_tweets.Rd @@ -4,7 +4,9 @@ \name{mayweather_mcgregor_tweets} \alias{mayweather_mcgregor_tweets} \title{Mayweather Vs McGregor Tweets} -\format{A data frame with 12118 rows representing tweets and 7 variables: +\format{Because of R package size restrictions, only a preview of the +first 10 rows of this dataset is included; to obtain the entire dataset +(12118 rows) see Examples below. A data frame with 10 rows representing tweets and 7 variables: \describe{ \item{created_at}{Time and date at which the tweet associated with the Mayweather vs. McGregor fight was sent.} \item{emojis}{Whether or not emojis were used in the tweet about the fight.} @@ -29,4 +31,18 @@ The raw data behind the story "The Mayweather-McGregor Fight As Told Through Emojis" \url{https://fivethirtyeight.com/?post_type=fte_features&p=161615}. } +\examples{ +# To obtain the entire dataset, run the code inside the following if statement: +if(FALSE){ + library(tidyverse) + url <- + "https://raw.githubusercontent.com/fivethirtyeight/data/master/mayweather-mcgregor/tweets.csv" + mayweather_mcgregor_tweets <- read_csv(url) \%>\% + mutate( + emojis = as.logical(emojis), + retweeted = as.logical(retweeted), + id = as.character(id) + ) +} +} \keyword{datasets} diff --git a/man/mlb_as_play_talent.Rd b/man/mlb_as_play_talent.Rd index 2481e58..9be6d27 100644 --- a/man/mlb_as_play_talent.Rd +++ b/man/mlb_as_play_talent.Rd @@ -11,7 +11,7 @@ \item{gamenum}{Order of All-Star Game for the season (in years w/ multiple ASGs; set to 0 when only 1 per year)} \item{gameid}{Game ID at Baseball-Reference.com} \item{lgid}{League of All-Star team} - \item{startingpos}{Postion (according to baseball convention; 1=pitcher, 2=catcher, etc.) if starter} + \item{startingpos}{Position (according to baseball convention; 1=pitcher, 2=catcher, etc.) if starter} \item{off600}{Estimate of offensive talent, in runs above league average per 600 plate appearances} \item{def600}{Estimate of fielding talent, in runs above league average per 600 plate appearances} \item{pitch200}{Estimate of pitching talent, in runs above league average per 200 innings pitched} diff --git a/man/nba_draft_2015.Rd b/man/nba_draft_2015.Rd index 24b6cc7..c940d65 100644 --- a/man/nba_draft_2015.Rd +++ b/man/nba_draft_2015.Rd @@ -26,5 +26,7 @@ nba_draft_2015 The raw data behind the story "Projecting The Top 50 Players In The 2015 NBA Draft Class" \url{https://fivethirtyeight.com/features/projecting-the-top-50-players-in-the-2015-nba-draft-class/}. +An analysis using this data was contributed by G. Elliott Morris as a package vignette at +\url{http://fivethirtyeight-r.netlify.com/articles/nba.html}. } \keyword{datasets} diff --git a/man/nfl_elo.Rd b/man/nfl_elo.Rd index c0de48f..aa4036e 100644 --- a/man/nfl_elo.Rd +++ b/man/nfl_elo.Rd @@ -4,7 +4,10 @@ \name{nfl_elo} \alias{nfl_elo} \title{The Complete History Of The NFL 2017 NFL Predictions} -\format{a data frame with 16,007 rows representing games and 14 variables: +\format{Because of R package size restrictions, only a preview of the +first 10 rows of this dataset is included; to obtain the entire dataset +(1920 to 2018 games) see Examples below. A data frame with 10 rows +representing games and 14 variables: \describe{ \item{date}{Date} \item{season}{Season year, 1920-2018} @@ -23,6 +26,15 @@ }} \source{ See \url{https://projects.fivethirtyeight.com/nfl-api/nfl_elo.csv} +# To obtain the entire dataset, run the following code: +library(tidyverse) +library(janitor) +nfl_elo <- read_csv("https://projects.fivethirtyeight.com/nfl-api/nfl_elo.csv") %>% + clean_names() %>% + mutate( + team1 = as.factor(team1), + team2 = as.factor(team2), + neutral = ifelse(neutral == 1, TRUE, FALSE)) } \usage{ nfl_elo diff --git a/man/nfl_fandom_surveymonkey.Rd b/man/nfl_fandom_surveymonkey.Rd index 70372a7..211efd2 100644 --- a/man/nfl_fandom_surveymonkey.Rd +++ b/man/nfl_fandom_surveymonkey.Rd @@ -8,29 +8,29 @@ \describe{ \item{team}{NFL team} \item{total_respondents}{Total number of poll respondents who ranked the given team in their top 3 favorites} -\item{asian_dem}{Number of asian, democrat poll respondents who ranked the given team in their top 3 favorites} -\item{black_dem}{Number of black, democrat poll respondents who ranked the given team in their top 3 favorites} -\item{hispanic_dem}{Number of hispanic, democrat poll respondents who ranked the given team in their top 3 favorites} -\item{other_dem}{Number of democrat poll respondents who identified their race as "other" (not asian, black, hispanic, or white) and ranked the given team in their top 3 favorites} -\item{white_dem}{Number of white, democrat poll respondents who ranked the given team in their top 3 favorites} +\item{asian_dem}{Number of Asian, democrat poll respondents who ranked the given team in their top 3 favorites} +\item{black_dem}{Number of Black, democrat poll respondents who ranked the given team in their top 3 favorites} +\item{hispanic_dem}{Number of Hispanic, democrat poll respondents who ranked the given team in their top 3 favorites} +\item{other_dem}{Number of democrat poll respondents who identified their race as "other" (not Asian, Black, Hispanic, or White) and ranked the given team in their top 3 favorites} +\item{white_dem}{Number of White, democrat poll respondents who ranked the given team in their top 3 favorites} \item{total_dem}{Total number of democrat poll respondents who ranked the given team in their top 3 favorites} -\item{asian_ind}{Number of asian, independent poll respondents who ranked the given team in their top 3 favorites} -\item{black_ind}{Number of black, independent poll respondents who ranked the given team in their top 3 favorites} -\item{hispanic_ind}{Number of hispanic, independent poll respondents who ranked the given team in their top 3 favorites} -\item{other_ind}{Number of independent poll respondents who identified their race as "other" (not asian, black, hispanic, or white) and ranked the given team in their top 3 favorites} -\item{white_ind}{Number of white, independent poll respondents who ranked the given team in their top 3 favorites} +\item{asian_ind}{Number of Asian, independent poll respondents who ranked the given team in their top 3 favorites} +\item{black_ind}{Number of Black, independent poll respondents who ranked the given team in their top 3 favorites} +\item{hispanic_ind}{Number of Hispanic, independent poll respondents who ranked the given team in their top 3 favorites} +\item{other_ind}{Number of independent poll respondents who identified their race as "other" (not Asian, Black, Hispanic, or White) and ranked the given team in their top 3 favorites} +\item{white_ind}{Number of White, independent poll respondents who ranked the given team in their top 3 favorites} \item{total_ind}{Total number of independent poll respondents who ranked the given team in their top 3 favorites} -\item{asian_gop}{Number of asian, republican poll respondents who ranked the given team in their top 3 favorites} -\item{black_gop}{Number of black, republican poll respondents who ranked the given team in their top 3 favorites} -\item{hispanic_gop}{Number of hispanic, republican poll respondents who ranked the given team in their top 3 favorites} -\item{other_gop}{Number of republican poll respondents who identified their race as "other" (not asian, black, hispanic, or white) and ranked the given team in their top 3 favorites} -\item{white_gop}{Number of white, republican poll respondents who ranked the given team in their top 3 favorites} +\item{asian_gop}{Number of Asian, republican poll respondents who ranked the given team in their top 3 favorites} +\item{black_gop}{Number of Black, republican poll respondents who ranked the given team in their top 3 favorites} +\item{hispanic_gop}{Number of Hispanic, republican poll respondents who ranked the given team in their top 3 favorites} +\item{other_gop}{Number of republican poll respondents who identified their race as "other" (not Asian, Black, Hispanic, or White) and ranked the given team in their top 3 favorites} +\item{white_gop}{Number of White, republican poll respondents who ranked the given team in their top 3 favorites} \item{total_gop}{Total number of republican poll respondents who ranked the given team in their top 3 favorites} \item{gop_percent}{Percent of fans (who ranked the team in their top 3 favorite NFL teams) who are republicans} \item{dem_percent}{Percent of fans who are democrats} \item{ind_percent}{Percent of fans who are independent} -\item{white_percent}{Percent of fans who are white} -\item{nonwhite_percent}{Percent of fans who are not white} +\item{white_percent}{Percent of fans who are White} +\item{nonwhite_percent}{Percent of fans who are not White} }} \source{ See \url{https://github.com/fivethirtyeight/data/tree/master/nfl-fandom/NFL_fandom_data-surveymonkey.csv} diff --git a/man/nfl_suspensions.Rd b/man/nfl_suspensions.Rd index e6bb1d8..d4bb2c1 100644 --- a/man/nfl_suspensions.Rd +++ b/man/nfl_suspensions.Rd @@ -9,7 +9,7 @@ \item{name}{first initial.last name} \item{team}{team at time of suspension} \item{games}{number of games suspended (one regular season = 16 games)} - \item{category}{personal conduct, substance abuse, peformance enhancing drugs or in-game violence} + \item{category}{personal conduct, substance abuse, performance enhancing drugs or in-game violence} \item{description}{description of suspension} \item{year}{year of suspension} \item{source}{news source} diff --git a/man/ratings.Rd b/man/ratings.Rd index f83d6b1..be2fcc9 100644 --- a/man/ratings.Rd +++ b/man/ratings.Rd @@ -43,7 +43,7 @@ ratings } \description{ The raw data behind the story -"Al Gore’s New Movie Exposes The Big Flaw In Online Movie Ratings" +"Al Gore's New Movie Exposes The Big Flaw In Online Movie Ratings" \url{https://fivethirtyeight.com/features/al-gores-new-movie-exposes-the-big-flaw-in-online-movie-ratings/}. } \examples{ diff --git a/man/tarantino.Rd b/man/tarantino.Rd index d72a247..ed3e7f0 100644 --- a/man/tarantino.Rd +++ b/man/tarantino.Rd @@ -21,5 +21,8 @@ tarantino The raw data behind the story "A Complete Catalog Of Every Time Someone Cursed Or Bled Out In A Quentin Tarantino Movie" \url{https://fivethirtyeight.com/features/complete-catalog-curses-deaths-quentin-tarantino-films/}. +An analysis using this data was contributed by Olivia Barrows, Jojo Miller, and Jayla Nakayama +as a package vignette at +\url{http://fivethirtyeight-r.netlify.com/articles/tarantino_swears.html}. } \keyword{datasets} diff --git a/man/trump_approval_poll.Rd b/man/trump_approval_poll.Rd index 6a54201..488ca83 100644 --- a/man/trump_approval_poll.Rd +++ b/man/trump_approval_poll.Rd @@ -16,8 +16,8 @@ \item{weight}{The weight fivethirtyeight gives the poll when determining approval ratings based on historical accuracy of the pollster} \item{approve}{The percentage of respondents who approve of the president} \item{disapprove}{The percentage of respondents who disapprove of the president} -\item{adjusted_approve}{The percentage of respondets who approve of the president adjusted for systematic tendencies of the polling firm} -\item{adjusted_disapprove}{The percentage of respondets who approve of the president adjusted for systematic tendencies of the polling firm} +\item{adjusted_approve}{The percentage of respondents who approve of the president adjusted for systematic tendencies of the polling firm} +\item{adjusted_disapprove}{The percentage of respondents who approve of the president adjusted for systematic tendencies of the polling firm} \item{multiversions}{True if there are multiple versions of the poll, False if there are not} \item{tracking}{TRUE if the poll was tracked, FALSE if not} \item{url}{Poll result URL} diff --git a/man/trump_twitter.Rd b/man/trump_twitter.Rd index ff4fb5e..479fc77 100644 --- a/man/trump_twitter.Rd +++ b/man/trump_twitter.Rd @@ -20,6 +20,8 @@ trump_twitter The raw data behind the story "The World's Favorite Donald Trump Tweets" \url{https://fivethirtyeight.com/features/the-worlds-favorite-donald-trump-tweets/}. -Tweets posted on twitter by Donald Trump (@realDonaldTrump) +Tweets posted on twitter by Donald Trump (@realDonaldTrump). +An analysis using this data was contributed by Adam Spannbauer as a package vignette at +\url{http://fivethirtyeight-r.netlify.com/articles/trump_twitter.html}. } \keyword{datasets} diff --git a/man/trumpworld_polls.Rd b/man/trumpworld_polls.Rd index 5c2b23c..25af9b1 100644 --- a/man/trumpworld_polls.Rd +++ b/man/trumpworld_polls.Rd @@ -4,7 +4,7 @@ \name{trumpworld_polls} \alias{trumpworld_polls} \title{What the World Thinks of Trump} -\format{A data frame with 32 rows representng years and 40 variables: +\format{A data frame with 32 rows representing years and 40 variables: \describe{ \item{year}{Year the poll was conducted} \item{avg}{The average percentage people who answered the poll question positively (support the president or have a favorable view of the U.S.)} @@ -27,7 +27,7 @@ \item{philippines}{The percentage of people from the Philippines who answered the poll question positively} \item{south_korea}{The percentage of people from South Korea who answered the poll question positively} \item{vietnam}{The percentage of people from Vietnam who answered the poll question positively} -\item{israel}{The percentage of people from Isreal who answered the poll question positively} +\item{israel}{The percentage of people from Israel who answered the poll question positively} \item{jordan}{The percentage of people from Jordan who answered the poll question positively} \item{lebanon}{The percentage of people from Lebanon who answered the poll question positively} \item{tunisia}{The percentage of people from Tunisia who answered the poll question positively} @@ -45,7 +45,7 @@ \item{mexico}{The percentage of people from Mexico who answered the poll question positively} \item{peru}{The percentage of people from Peru who answered the poll question positively} \item{venezuela}{The percentage of people from Venezuela who answered the poll question positively} -\item{question}{The item being polled. Specificially, whether respondents: 1) Have a favorable view of the U.S. or 2) Trust the U.S. President when it comes to foreign affairs} +\item{question}{The item being polled. Specifically, whether respondents: 1) Have a favorable view of the U.S. or 2) Trust the U.S. President when it comes to foreign affairs} }} \source{ Pew Research Center \url{http://www.pewresearch.org/fact-tank/2017/07/17/9-charts-on-how-the-world-sees-trump/} diff --git a/vignettes/NBA.html b/vignettes/NBA.html index bb3bde8..0669240 100644 --- a/vignettes/NBA.html +++ b/vignettes/NBA.html @@ -12,7 +12,7 @@ - + 2015 NBA player predictions analysis using the tidyverse @@ -70,7 +70,7 @@

    2015 NBA player predictions analysis using the tidyverse

    G. Elliott Morris and Chester Ismay

    -

    2018-02-09

    +

    2018-02-11

    @@ -176,7 +176,7 @@

    Graph it!

    plot.title = element_text(face = "bold", size = 20), plot.subtitle = element_text(size = 12), plot.caption = element_text(hjust = 0, size = 10)) -

    +

    The overall trend here is that NBA draft classes, on average, have shown an increase in mean projected plus-minus since 2003. Based on this analysis, 2015 is the best draft class since it has the highest mean projected plus-minus of any year. Another way to think of this is that 2015 was the most balanced based on this metric. This plot also shows that the draft classes have tended to be projected as having more impact on team success over time.

    diff --git a/vignettes/bechdel.Rmd b/vignettes/bechdel.Rmd index cf075b1..69a2262 100644 --- a/vignettes/bechdel.Rmd +++ b/vignettes/bechdel.Rmd @@ -1,6 +1,6 @@ --- title: "Bechdel analysis using the `tidyverse`" -author: "Albert Y. Kim, Chester Ismay, and Jennifer Chunn" +author: "Chester Ismay" date: "`r Sys.Date()`" output: rmarkdown::html_vignette: diff --git a/vignettes/bechdel.html b/vignettes/bechdel.html index bb23fb7..39dfe5f 100644 --- a/vignettes/bechdel.html +++ b/vignettes/bechdel.html @@ -10,9 +10,9 @@ - + - + Bechdel analysis using the tidyverse @@ -69,8 +69,8 @@

    Bechdel analysis using the tidyverse

    -

    Albert Y. Kim, Chester Ismay, and Jennifer Chunn

    -

    2018-02-09

    +

    Chester Ismay

    +

    2018-02-11

    @@ -276,7 +276,7 @@

    Bechdel dummy is not a significant predictor of log(intgross_2013)color = binary)) + geom_point() + geom_smooth(method = "lm", se = FALSE)

    -

    +

    gross_vs_budget_binary <- lm(log(intgross_2013) ~ log(budget_2013) + factor(binary), 
                           data = bechdel90_13)
     tidy(gross_vs_budget_binary)
    @@ -367,7 +367,7 @@

    Bechdel dummy is not a significant predictor of log(roi_total) color = binary)) + geom_point() + geom_smooth(method = "lm", se = FALSE) -

    +

    roi_vs_budget_binary <- lm(log(roi_total) ~ log(budget_2013) + factor(binary), 
                           data = bechdel90_13)
     tidy(roi_vs_budget_binary)
    @@ -465,7 +465,7 @@

    Dollars Earned for Every Dollar Spent graphic

    labs(title = "Dollars Earned for Every Dollar Spent", subtitle = "2013 dollars") + scale_fill_fivethirtyeight() + theme_fivethirtyeight() -

    +

    Attempt to fully reproduce Dollars Earned for Every Dollar Spent plot using ggplot

    ggplot(data = med_groups, mapping = aes(x = clean_test, y = median_roi, 
                                             fill = group)) +
    @@ -486,7 +486,7 @@ 

    Dollars Earned for Every Dollar Spent graphic

    axis.text.x = element_blank(), axis.ticks.x = element_blank()) + guides(fill = FALSE)
    -

    +

    diff --git a/vignettes/biopics.html b/vignettes/biopics.html index 22c1df7..bd5b225 100644 --- a/vignettes/biopics.html +++ b/vignettes/biopics.html @@ -102,7 +102,7 @@

    Looking at Biopics of Hollywood

    Pradeep Adhokshaja

    -

    09 February, 2018

    +

    11 February, 2018

    @@ -170,7 +170,7 @@

    % Wise Plot By Decade

    theme(axis.text.x = element_text(vjust=1,angle=90)) + scale_y_continuous(labels = percent) + labs(x="Decade",y="Percentage Composition",title="How do the % of movies involving actors of color change by decade?",caption="Data From: FiveThirtyEight") -

    +

    The percentage of movies that had actors of color was the highest in the period 2010-2014. Biopics that had actors of color were non existent during the period 1910-1930.

    @@ -185,8 +185,8 @@

    Type of Subjects covered

    mutate(n=round(n,2)) %>% hchart("treemap", hcaes(x = type_of_subject, value = n, color = n)) %>% hc_title(text="Type of Subjects of Movies involving White Actors(%)")
    -
    - +
    +

    Actors of Color

    biopics %>% 
       mutate(person_of_color=ifelse(person_of_color==0,"White","Person of Color")) %>%
    @@ -197,8 +197,8 @@ 

    Type of Subjects covered

    mutate(n=round(n,2)) %>% hchart("treemap", hcaes(x = type_of_subject, value = n, color = n)) %>% hc_title(text="Type of Subjects of Movies involving Actors of Color(%)")
    -
    - +
    +

    A side by side comparison

    biopics %>% 
       mutate(person_of_color = ifelse(person_of_color==0,"White","Person of Color")) %>%
    @@ -212,7 +212,7 @@ 

    Type of Subjects covered

    facet_wrap(~person_of_color)+ coord_flip()+ labs(title="How do subject coverage differ in biopics involving white actors and actors of color?",caption="Data From : FiveThirtyEight",x="Type of Subject",y="%")
    -

    +

    • Within biopics that had actors of color, topics like Athelete,Activist,Singer,World Leader and Actor had a higher coverage than in biopics that had white actors.
    @@ -234,7 +234,7 @@

    Frequency of Movies Involving White Actors and Actors of Color

    geom_vline(xintercept=1974,linetype=2)+ geom_text(aes(1974,0),label="First Successful African American themed Sitcom",show.legend = F, hjust=0,vjust=1,inherit.aes = F,angle=90,size=3,colour="black") -

    +

    The vertical dashed line above indicates the year 1964, when the Civil Rights’ Act was passed. The number of biopics depicting colored persons went up in the 1970’s. The first successful African American themed sitcom was released in the year 1974 (“Good Times”).

    @@ -253,7 +253,7 @@

    Number of Biopics for each gender

    subtitle="",caption="Data from FiveThirtyEight")+ scale_x_continuous(breaks = seq(1920,2014,5))+ theme(plot.title=element_text(size=18),axis.text.x = element_text(angle=90, vjust=1)) -

    +

    Change in the number of movies from previous years

    @@ -280,7 +280,7 @@

    Change in the number of movies from previous years

    facet_wrap(~subject_sex,scales = "fixed")+ scale_x_continuous(breaks = seq(1920,2014,5)) + theme(plot.title=element_text(size=18),axis.text.x = element_text(angle=90, vjust=1))
    -

    +

    The change in the number of biopics that had male subjects shot up in 2014.

    @@ -316,8 +316,8 @@

    What kind of subjects do movies about male and female protaganists deal with labs(y = "Biopics Involving Men", x ="Biopics Involving Women",text=element_text(size=10), plot.title=element_text(hjust=0.5))+ ggtitle("Relative Frequency of Subjects(Gender Wise)")

    -
    ## Warning: Removed 17 rows containing missing values (geom_point).
    -

    +
    ## Warning: Removed 18 rows containing missing values (geom_point).
    +

    Topics that are close to the line indicate topics that have similar frequencies in both the sets of data. These topics include government,academic and activist. Topics that are far from this line are topics that are found frequently in one set but not the other.For example,a larger percentage of biopics that involved women,portrayed authors. By looking at the other side, topics like military had a higher percentage of coverage in biopics involving men than women.More the red color of the text, the more frequently the topic appears in biopics related to men.

    @@ -341,7 +341,7 @@

    Race and Gender

    facet_grid(subject_sex~.)+ theme(plot.title=element_text(size=18),axis.text.x = element_text(angle=90, vjust=1))+ labs(caption="Data From FiveThirtyEight")
    -

    +

    Most of the biopics depict White Americans followed by African Americans.

    @@ -371,7 +371,7 @@

    Distributions of earnings per year

    subtitle="Inflation not taken into account(Diamond Point Represents Mean)",caption="Data From FiveThirtyEight")+ facet_wrap(~subject_sex,ncol=1)+ theme(axis.text.x = element_text(angle=90,vjust=1)) -

    +

    A large number of movies earned below $100M.As we progress through the 80’s, these numbers go higher , especially in the case of biopics based on men. The highest earning movie based on a female protaganist was released in 1964.This was the “Sound of Music” which earned approximately $163M.

    diff --git a/vignettes/bob_ross.html b/vignettes/bob_ross.html index e2c83eb..3494345 100644 --- a/vignettes/bob_ross.html +++ b/vignettes/bob_ross.html @@ -11,7 +11,7 @@ - + Bob Ross - Joy of Painting- @@ -121,7 +121,7 @@

    Bob Ross - Joy of Painting-

    Jonathan Bouchet

    -

    2018-02-09

    +

    2018-02-11

    @@ -177,7 +177,7 @@

    Frequency

    coord_flip() + theme_fivethirtyeight() + ggtitle('Features\'s appearance(%) through all episodes') -

    +

    • tree and trees features appear in more than 90% of all the paintings.
    @@ -216,7 +216,7 @@

    Episodes having the greatest number of features

    geom_bar(stat='identity') + coord_flip() + theme_fivethirtyeight() + ggtitle(paste0('Paintings having more than ', cut_features,' features')) -

    +

    Episodes distribution vs. their number of features

    @@ -231,7 +231,7 @@

    Episodes distribution vs. their number of features

    geom_bar(stat='identity') + geom_text(aes(label=label), position=position_dodge(width=0.9), vjust=-1,hjust=.5,size=2.5,color='red')+ theme_fivethirtyeight() + ggtitle('Distribution of paitings vs. \n number of features') -

    +

    • the mean number of features among all paintings is:
    @@ -288,7 +288,7 @@

    Result with all paintings for the first season

    geom_edge_fan(aes(width=E(g1)$weight),alpha=.25,show.legend = FALSE) + geom_node_point(size=6,color="red",alpha=1) + geom_node_text(aes(label = name)) + theme_fivethirtyeight() + ggtitle('Features network of all paintings of season 1') -

    +

    • larger width indicate the frequency of this correlation
    • the most frequent conenction are tree | trees, tree | lake, lake | mountain, which makes sense as seen with the correlation plot.
    • diff --git a/vignettes/comics_gender.html b/vignettes/comics_gender.html index 61998c4..6ca32fd 100644 --- a/vignettes/comics_gender.html +++ b/vignettes/comics_gender.html @@ -11,7 +11,7 @@ - + Gender in Comic Books @@ -121,7 +121,7 @@

      Gender in Comic Books

      Jonathan Bouchet

      -

      2018-02-09

      +

      2018-02-11

    @@ -177,7 +177,7 @@

    Overview plots

    theme(legend.position = 'None') grid.arrange(percentage_per_publisher, raw_number_per_publisher, ncol=2) -

    +

    • Marvel has more than the double of number of characters compared to DC.
    • Male are more present in both publishers compared to Female on a ~2.5:1 ratio, while LGBT characters represent less than 1 percent.
    • @@ -221,7 +221,7 @@

      Number of Characters vs. Time

      xlim(1935,2015) grid.arrange(rbind(ggplotGrob(plot_marvel_time), ggplotGrob(plot_dc_time), size = "last")) -

      +

      • Most of the characters are either Female or Male for both publishers.
      • There is a gap in character’s creation (for both publishers) ~1955-1960.
      • @@ -329,7 +329,7 @@

        Popularity

        op <- par(mar = c(1, 2, 2, 1), mfrow = c(1, 2)) wordcloud(dc_appearances$name, dc_appearances$appearances, min.freq = 100, colors = color_dc(10), scale = c(1.75, 0.2)) wordcloud(marvel_appearances$name, marvel_appearances$appearances, min.freq = 250, colors = color_marvel(10), scale = c(1.5, 0.2)) -

        +

        • Batman(DC) and Spider-Man(Marvel) ends up being the characters with the most appearances.
        diff --git a/vignettes/fivethirtyeight.html b/vignettes/fivethirtyeight.html index c45568a..67f24f9 100644 --- a/vignettes/fivethirtyeight.html +++ b/vignettes/fivethirtyeight.html @@ -12,7 +12,7 @@ - + fivethirtyeight Package @@ -32,7 +32,7 @@

        fivethirtyeight Package

        Albert Y. Kim, Chester Ismay, and Jennifer Chunn

        -

        2018-02-09

        +

        2018-02-11

        diff --git a/vignettes/tarantino_swears.html b/vignettes/tarantino_swears.html index 74a61a9..e8e7710 100644 --- a/vignettes/tarantino_swears.html +++ b/vignettes/tarantino_swears.html @@ -12,7 +12,7 @@ - + How Many Fucks Does Tarantino Give? @@ -70,7 +70,7 @@

        How Many Fucks Does Tarantino Give?

        Olivia Barrows, Jojo Miller, and Jayla Nakayama

        -

        2018-02-09

        +

        2018-02-11

        @@ -120,7 +120,7 @@

        Total Swear Word Usage Over Tarantino’s Career

        theme_fivethirtyeight() + labs(x = "Movie", y = "Swear Count", title = "Total Swear Word Usage Per Movie") + theme(axis.text.x = element_text(angle = 45, hjust = 1)) -

        +

        @@ -382,14 +382,14 @@

        How Many Fucks Does Tarantino Actually Give?

        theme_fivethirtyeight() + labs(x ="Minutes In", y ="Fucks Given", title ="Fucks Tarantino Gives Per Movie") + theme(axis.text.x =element_text(angle =45, hjust =1)) -

        +

        This can be further broken down to show what types of fucks Tarantino gives.

        ggplot(data = tarantino_fuck, mapping = aes(x = minutes_in, fill = word)) +
           geom_histogram(binwidth = 10, color = "white") + facet_wrap(~movie) +
           theme_fivethirtyeight() +
           labs(x = "Minutes In", y = "Fucks Given", title = "Fucks Tarantino Gives Per Movie (by Type)") +
           theme(axis.text.x = element_text(angle = 45, hjust = 1))
        -

        +

        From this information, it is possible to see that in terms of fucks given:

        • Tarantino most often uses the variations ‘fuck’ and ‘fucking’
        • diff --git a/vignettes/trump_twitter.html b/vignettes/trump_twitter.html index 0dc0356..1460f3b 100644 --- a/vignettes/trump_twitter.html +++ b/vignettes/trump_twitter.html @@ -12,7 +12,7 @@ - + Trump Twitter analysis using the tidyverse @@ -70,7 +70,7 @@

          Trump Twitter analysis using the tidyverse

          Adam Spannbauer and Jennifer Chunn

          -

          2018-02-09

          +

          2018-02-11

          @@ -297,19 +297,19 @@

          When is trumps favorite time to tweet?

          ggtitle(paste("Trump Tweet Count & Sentiment by", timeVarLabel)) }
          plotSentByTime(trump_tweet_times, hour)
          -

          +

          • Trump tweets the least between 4 and 10 am.
          • Trump’s tweets are most positive during the 10am hour.
          plotSentByTime(trump_tweet_times, weekday)
          -

          +

          • Trump tweeted the most on Tuesday and Wednesday
          • Trump was most positive in the second part of the work week (Wed, Thurs, Fri)
          plotSentByTime(trump_tweet_times, month_over_time)
          -

          +

          • In this dataset, the number of tweets decreased after November 2015 and drastically dropped off after March 2016. It is unclear if this is a result of actual decrease in tweeting frequency or a result of the data collection process.
          diff --git a/vignettes/user_contributed_vignettes.R b/vignettes/user_contributed_vignettes.R new file mode 100644 index 0000000..d908392 --- /dev/null +++ b/vignettes/user_contributed_vignettes.R @@ -0,0 +1,4 @@ +## ----install, eval=FALSE------------------------------------------------- +# # install.packages("remotes") +# remotes::install_github("rudeboybert/fivethirtyeight", build_vignettes = TRUE) + diff --git a/vignettes/user_contributed_vignettes.Rmd b/vignettes/user_contributed_vignettes.Rmd new file mode 100644 index 0000000..361ebe3 --- /dev/null +++ b/vignettes/user_contributed_vignettes.Rmd @@ -0,0 +1,30 @@ +--- +title: "User-Contributed Vignettes" +author: "Chester Ismay" +date: "`r Sys.Date()`" +output: + rmarkdown::html_vignette: + df_print: kable +vignette: | + %\VignetteIndexEntry{User-Contributed Vignettes} + %\VignetteEngine{knitr::rmarkdown} + %\VignetteEncoding{UTF-8} +--- + +Due to CRAN space limitations on packages, user-contributed vignettes that walk through different analyses using the data sets in the `fivethirtyeight` package are linked below in this "vignette of vignettes." You can find both the R Markdown file needed to generate the file and also a link to the HTML vignette on the package website at . The vignette title links to the HTML version and the (Rmd) immediately following links to the R Markdown source. We encourage others to share their analyses using the `fivethirtyeight` data sets. + +The developmental version of the package stored on GitHub contains all of the vignettes so if you'd like to build the package locally, first install the [`remotes` package](https://CRAN.R-project.org/package=remotes) and then install the package via + +```{r install, eval=FALSE} +# install.packages("remotes") +remotes::install_github("rudeboybert/fivethirtyeight", build_vignettes = TRUE) +``` + +## Analyses + +- [Looking at the Biopics of Hollywood](http://fivethirtyeight-r.netlify.com/articles/biopics.html) by Pradeep Adhokshaja [(Rmd)](https://raw.githubusercontent.com/rudeboybert/fivethirtyeight/master/vignettes/biopics.Rmd) +- [Bob Ross - Joy of Painting](http://fivethirtyeight-r.netlify.com/articles/bob_ross.html) by Jonathan Bouchet [(Rmd)](https://raw.githubusercontent.com/rudeboybert/fivethirtyeight/master/vignettes/bob_ross.Rmd) +- [Gender in Comic Books](http://fivethirtyeight-r.netlify.com/articles/comics_gender.html) by Jonathan Bouchet [(Rmd)](https://raw.githubusercontent.com/rudeboybert/fivethirtyeight/master/vignettes/comics_gender.Rmd) +- [2015 NBA player predictions analysis using the `tidyverse`](http://fivethirtyeight-r.netlify.com/articles/nba.html) by G. Elliott Morris (with support from Chester Ismay) [(Rmd)](https://raw.githubusercontent.com/rudeboybert/fivethirtyeight/master/vignettes/NBA.Rmd) +- [How Many Fucks Does Tarantino Give?](http://fivethirtyeight-r.netlify.com/articles/tarantino_swears.html) by Olivia Barrows, Jojo Miller, and Jayla Nakayama [(Rmd)](https://raw.githubusercontent.com/rudeboybert/fivethirtyeight/master/vignettes/tarantino_swears.Rmd) +- [Trump Twitter analysis using the `tidyverse`](http://fivethirtyeight-r.netlify.com/articles/trump_twitter.html) by Adam Spannbauer (with support from Jennifer Chunn) [(Rmd)](https://raw.githubusercontent.com/rudeboybert/fivethirtyeight/master/vignettes/trump_twitter.Rmd) diff --git a/vignettes/user_contributed_vignettes.html b/vignettes/user_contributed_vignettes.html new file mode 100644 index 0000000..fa3865a --- /dev/null +++ b/vignettes/user_contributed_vignettes.html @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + +User-Contributed Vignettes + + + + + + + + + + + + + + + + + +

          User-Contributed Vignettes

          +

          Chester Ismay

          +

          2018-02-11

          + + + +

          Due to CRAN space limitations on packages, user-contributed vignettes that walk through different analyses using the data sets in the fivethirtyeight package are linked below in this “vignette of vignettes.” You can find both the R Markdown file needed to generate the file and also a link to the HTML vignette on the package website at https://fivethirtyeight-r.netlify.com. The vignette title links to the HTML version and the (Rmd) immediately following links to the R Markdown source. We encourage others to share their analyses using the fivethirtyeight data sets.

          +

          The developmental version of the package stored on GitHub contains all of the vignettes so if you’d like to build the package locally, first install the remotes package and then install the package via

          +
          # install.packages("remotes")
          +remotes::install_github("rudeboybert/fivethirtyeight", build_vignettes = TRUE)
          +
          +

          Analyses

          + +
          + + + + + + + +