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

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 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

(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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!