Publications by Ethan Haley
Document
Principles of Data Visualization and Introduction to ggplot2 I have provided you with data about the 5,000 fastest growing companies in the US, as compiled by Inc. magazine. Let’s read this in: And let’s preview this data: head(inc) ## Rank Name Growth_Rate Revenue ## 1 1 Fuhu 421.4...
2554 sym R (7350 sym/15 pcs) 3 img
Why Some People Choose Not To Vote
Overview of FiveThirtyEight’s article exploring why people don’t vote This article, using polling data gathered 49-39 days before the latest U.S. presidential election, in which the highest percentage of eligible voters since 1900 actually voted, takes a look at why non-voters may choose or need to remain on the sidelines. Presumably the conc...
2771 sym R (5146 sym/7 pcs) 5 img
Document
uni <- c(rep(5,13), rep(6,13), rep(7,13), rep(8,13),rep(9,13), rep(10,13)) uni ## [1] 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 ## [26] 6 7 7 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 ## [51] 8 8 9 9 9 9 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 ## [76] 10 10 10 lib...
14 sym R (831 sym/7 pcs) 1 img
Document
simulate_flips <- function(choice_flips, n_trials, pct_heads, win_prop) { ### You pick choice_flips, for n_trials, with fair coin = 50 pct_heads, ### and you have to beat win_prop proportion of flips being heads # set seed set.seed(606) # simulate the success of your choice wins <- 0 # simulate n_trials for each choice for (i in ...
11 sym R (942 sym/5 pcs)
Document
Transform a text representation of a chess tourney and extract info we want # Check the format of the input file tourney <- read.csv("../Project1/tournamentinfo.txt", nrows = 7) tourney ## X......................................................................................... ## 1 Pair | Player Name |Total|Round|Round|Ro...
1489 sym R (10618 sym/28 pcs)
Document
Dice rolls. (3.6, p. 92) If you roll a pair of fair dice, what is the probability of getting a sum of 1? getting a sum of 5? getting a sum of 12? diceSides <- 6 twoDice <- matrix(nrow = diceSides, ncol = diceSides) for (die1 in 1:diceSides) { for (die2 in 1:diceSides) { twoDice[die1, die2] = die1 + die2 } } outcomes <- diceSides * dice...
5206 sym R (5076 sym/41 pcs) 1 img
Document
Get some data about college majors, from fivethirtyeight.com’s Github dataURL <- "https://raw.githubusercontent.com/fivethirtyeight/data/master/college-majors/majors-list.csv" majors <- read.csv(url(dataURL)) majors <- majors$Major majors[1:11] ## [1] "GENERAL AGRICULTURE" ## [2] "AGRICULTURE PRODUCTION AND MANAGEMENT" ## [...
1735 sym R (1906 sym/10 pcs)
606ProjProposal
Data Preparation These data will be scraped from the website of the creators of CryptoPunks. Additional historical data will include Ethereum/USD rates and recent digital art token (NFT) sales prices. Research question You should phrase your research question in a way that matches up with the scope of inference your dataset allows for. How much ...
2526 sym R (3175 sym/18 pcs) 10 img
tidymodels for pets
Data Source: PetFinder competition on Kaggle, 2019 ‘https://www.kaggle.com/c/petfinder-adoption-prediction/data’ Kaggle ran a competitiion in 2019 aiming to help PetFinder rescue shelters in Malaysia. PetFinder wanted to predict which of its incoming, rescued cats and dogs would be most likely to get adopted fastest. This could help them for...
8984 sym R (13915 sym/60 pcs) 4 img 2 tbl
NYT-API to R frame
Notes from the Times API page: Pagination Use the offset query parameter to paginate thru the results, 25 comments at a time. Use offset=0 to get the first 25 comments, offset=25 to get the next 25 comments, … The url.json endpoint returns top-level comments and the first three replies. The totalParentCommentsFound field has the total number of...
1613 sym R (2177 sym/3 pcs) 1 tbl