Question: Using the baseball data in the Lahman package, calculate median baseball salary by team: #a. Using a for loop #b. Using a function from the
Using the baseball data in the Lahman package, calculate median baseball salary by team: #a. Using a for loop #b. Using a function from the apply family #c. Using dplyr #d. Write a short paragraph explaining which of the above is your preferred method, #and why you prefer it (no wrong answer on part d, we're just looking for your thoughts) The documentation for vapply says it is a "safer" way to run sapply. Create an empty list #and sum it using both sapply #and vapply. Write a short paragraph about why using sapply could produce problems
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
