Question: Using R to answer belows question. These questions is relative, code only. I will thumb uppp! Thank you (a) Import tae.txt into a data frame
Using R to answer belows question. These questions is relative, code only. I will thumb uppp! Thank you





![Look at the col_names and skip options for read_table.] After importing the](https://s3.amazonaws.com/si.experts.images/answers/2024/09/66de8fa57ac59_79766de8fa52948c.jpg)
(a) Import "tae.txt" into a data frame called tae_df using read_table(...) It is similar to read_csv but for reading data whose fields are separated by whitespace. Be careful to not read the first row of the data as the column names. [Hint: Look at the col_names and skip options for read_table.] After importing the data, R will still automatically create a name for each column. Use colnames to get the names of columns of tae_df and save them in variable names_by_R. (b) Use write_csv to write tae_df into a csv file called "tae.csv". You don't have write access to ClassData folder, so please write the file to the working directory. Do not write the column names in the first line and "tae.csv" should directly begins with the 1st row of data. [Hint: Look at the col_names option for write_csv] 1. Put the data LCDataSmall.csv into a data frame called df using read_csv(...) You must read "NA", empty string, and "n/a" in the csv files as NA. Print the type of each column using "sapply" and "class". 2. Alter the levels of df\$default from "Fully Paid" and "Charged Off" to " 0 " and " 1 ", respectively. 3. Merge the levels "A" andd "B" of column grade into one level called "AtLeastB". Merge the levels "C", "D", and "E", into one level called "LowerThanB" . 4. Create a new column df\$fico_avg which equals the average of df\$fico_high and df\$fico_low
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
