Choose one of David Robinson’s tidytuesday screencasts, watch the video, and summarise. https://www.youtube.com/channel/UCeiiqmVK07qhY-wvg3IZiZQ
You must follow the instructions below to get credits for this assignment.
The screencast title of the video i chose is "‘The Riddler’ screencast: simulating a week of rain. This screencast focuses on demonstrating an example of Monte carlo simulation in R.
The screencast was posted December 12th 2018, but the column was published July 12th, 2018.
Hint: What’s the source of the data; what does the row represent; how many observations?; what are the variables; and what do they mean?
The data in the probability problem is represented through a work week of five days, five mornings, five evenings. there are two umbrellas at home and one at work. The Probability question is “what is the probability that he makes it through the work week without getting wet?”
Hint: For example, importing data, understanding the data, data exploration, etc.
Dave starts with using tidy Simulations. you use markdown in R and input: library(tidyverse) with crossing(trial = 1:100, weekdays = 1:5, commute = c(“Morning”, “Evening”) )%>% arrange(trial, weekday, desc(commute))%>% which represents the tidy simulation pattern. he then added: mutate(rain = rbinom(n(), 1, ifelse(commute == “1. morning”, .5, .4))) home_change = ifelse(commute == “Morning” & rain ~ -1, Commute == “Evening” & rain ~ 1, true ~ 0), office_change = -home_change) %>% group_by(trial) %>% mutate(home = cumsum( Home 2 + home_change), office = 1 + cumcum(office_change)) %>% view()
this represents the percentage of rain mornings and evenings, how many umbrellas louie has at home and the office, home change vs office change, how many umbrellas will be at each step, and the accumulated sum of the change of the data.
While watching the video there were many aspects of the code that Dave typed in that did remind me of things learned in class. While he didn’t produce any graphs, in detail he covered the steps it takes to organize data tables. While the coding was complex, it was interesting watching him input it and make it work.
through multiple tries Dave found that 69.3% of the time louie was able to make it through the week with enough umbrellas.
The most interesting thing from the analysis was watching Dave build the data inputs. it was really cool to watch him try one way, watch it not work as well as he wanted and then go back in and changing it slightly to receive an output that he preferred. I found it interesting that he knew the coding literally like a second language. As someone who has always wondered what exactly coding looked like, this was a really cool video to watch.