Please answer in R programming language:

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Please answer in R programming language:

Post by answerhappygod »

Please answer in R programming language:
Please Answer In R Programming Language 1
Please Answer In R Programming Language 1 (36.42 KiB) Viewed 54 times
Q2. Below is an R function that takes a numeric vector as an argument and returns the difference between the largest and smallest item in the vector x. (15 points: 5+10] DiffMaxMin <- function(x){ return(max(x)-min(x)) } Now use map functionality and the above DiffMaxMin function to get the difference between the largest and smallest item in each column of a numeric data frame df given below. Note that the purpose of map functions is to avoid using loops. df <- data.framel a = rnorm(10), b = rnorm(10), C= rnorm(10), d = rnorm(10) ) • Perform the above task by using for-loop and without using map or lapply functionalities.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply