Question: Hello, I have R programming questions. I need your help. Thank you. f3. In daily fantasy sports it is often helpful to calculate a player's

Hello, I have R programming questions.

I need your help.

Thank you.

Hello, I have R programming questions.I need your help.Thank you. \f3. Indaily fantasy sports it is often helpful to calculate a player's \"Boom/ Bust\" percentages. A player's \"Boom\" percentage (at least for me) is

\f3. In daily fantasy sports it is often helpful to calculate a player's \"Boom / Bust\" percentages. A player's \"Boom\" percentage (at least for me) is the likelihood my algorithm thinks the fantasy points they earn will be 5 times their salary or more, while the \"Bust\" percentage is the likelihood they will earn less than 5 times their salary. Obviously, it is far more advantageous to roster players whose \"Boom\" percentage is higher than their \"Bust\" percentage. In this question we are going to use if() , else () and 1while () statement(s) to create a new dataframe called goodbad that lists the players in the \"Good\" column if they're more likely to boom and lists players in the \"Bad\" column if they are more likely to bust. (a) Read in the boombust . cav file and save it to bb (b) Omit any NA rows by running the code: bb = na. omit (bb) (c) It will be useful to know the length of the dataset, so run the code: n = dim(bb) [1] which saves the number of rows of the dataset to the variable n. (d) We need to create a new dataframe to store our Good / Bad player names. To do this run the following two lines of code: i. goodbad = data. frame (matrix (ncol = 2, nrow = n) ) ii. colnames (goodbad) = c("Good", "Bad") (e) Write a while statement with an if-else statement inside of it to traverse the bb dataset. For each row of bb you will need to calculate whether the player's boom is greater than or equal to their bust. Use j as your index variable. If the player's boom is greater than or equal to their bust, save the player's name to the "Good" column of goodbad, and if their bust is greater than their boom save the player's name to the "Bad" column of goodbad. (f) Use the following code to print out the number of players classified as "Good": length (goodbad$Good [!is . na(goodbad$Good)]) (g) Use the following code to print out the number of players classified as "Bad": length (goodbad$Bad [!is . na (goodbad$Bad) ])

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!