Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Use R Program a) [8 points] Create a function named all_loan_offers that satisfies the following requirements: Arguments: - A data frame that stores the income,
Use R Program
a) [8 points] Create a function named all_loan_offers that satisfies the following requirements: Arguments: - A data frame that stores the income, criminal record, and the number of years in the present job for all loan applicants. You can use a name of your choice for the data frame, but the column names must be income, c_record, and years. - Output: The updated version of the inputted data frame which has a new column titled "decision". "decision" is a categorical column whose elements can take any values of "Admit" or "Reject". Please note that the function must return the updated data frame not the decision vector. b) [1 point] Please assume that the following table shows the information of four loan applicants. Save the information in the above table in a data frame named applicants_info. Name the columns income, c_record, and years. c) [1 point] Run your function using applicants_info as its input. You should see the updated applicants_info including the decision column of "Reject" "Admit" "Reject" "Admit" as the function's outputStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started