Question: submit a R-script You are given the following data. AGE INCOME GENDER RISK 31 59193 Female Low 45 58381 Male Low 43 57388 Female High
submit a R-script
You are given the following data.
| AGE | INCOME | GENDER | RISK |
| 31 | 59193 | Female | Low |
| 45 | 58381 | Male | Low |
| 43 | 57388 | Female | High |
| 41 | 56470 | Male | Medium |
| 36 | 55554 | Female | High |
| 32 | 54792 | Male | Medium |
- Please use the age data to create a vector called age.
- Please use the income data to create a vector called income
- Please use the gender data to create a vector called gender.
- Please use the risk data to create a vector called risk. The order level for risk is low < medium
- Please check the class of each vector: age & income should be numeric; gender should be factor; and risk should be ordered factor.
- Please create a data frame called mydata using the four vectors.
- After create mydata, please display
- The second record
- Please display only the risk column using $
- Only show record 2 to 4
- For all records, please display only income and risk columns using one statement.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
