Question: R Coding - Instructions - The hmeq _ small dataset contains information on 5 9 6 0 home equity loans, including 7 features on the

R Coding - Instructions -
The hmeq_small dataset contains information on 5960 home equity loans, including 7 features on the characteristics of the loan.
-Load the hmeq_small.csv data set as a data frame.
-Create a new data frame with the columns LOAN and VALUE
-standardized and saved as LOAN_STAND and VALUE_STAND.
-Create a second data frame with the columns LOAN and VALUE
-normalized and saved as LOAN_NORM and VALUE_NORM.
-Print the summaries of the new data frames.
The expected output is shown on screenshot, I cannot show them all but basically looks like that. I tried it twice, and it still shows errors! I need help.
The first error :
suppressPackageStartupMessages(library(tidyverse))
# Load the dataset
hmeq - read.csv("hmeq_small.csv")
# Drop rows with NAs
hmeq - na.omit(hmeq)
# Standardize the columns LOAN and VALUE
hmeqStand - hmeq %>%
mutate(LOAN_STAND = scale(LOAN), VALUE_STAND = scale(VALUE))
# Normalize the columns LOAN and VALUE
hmeqNorm - hmeq %>%
mutate(LOAN_NORM = scale(LOAN, center = min(LOAN), scale = diff(range(LOAN))),
VALUE_NORM = scale(VALUE, center = min(VALUE), scale = diff(range(VALUE))))
# Print the summaries of the data frames
cat("Summary of standardized data:
")
summary(hmeqStand)
cat("
Summary of normalized data:
")
summary(hmeqNorm)
The second error:
suppressPackageStartupMessages(library(tidyverse))
hmeq - read.csv("hmeq_small.csv")
# Drop rows with NAs
hmeq - drop_na(hmeq)
# Standardize the columns LOAN and VALUE
hmeqStand - hmeqStand - hmeq %>%
mutate(LOAN_STAND = scale(LOAN),
VALUE_STAND = scale(VALUE))
# Normalize the columns LOAN and VALUE
hmeqNorm - hmeqNorm - hmeq %>%
mutate(LOAN_NORM = scale(LOAN, center = min(LOAN), scale = diff(range(LOAN))),
VALUE_NORM = scale(VALUE, center = min(VALUE), scale = diff(range(VALUE))))
# Print the summaries of the data frames hmeqStand and hmeqNorm
print("Summary of standardized data:")
summary(hmeqStand)
print("Summary of normalized data:")
summary(hmeqNorm)
The R programing lines
suppressPackageStartupMessages(library(tidyverse))
hmeq - # Your code here
# Drop rows with NAs
hmeq - drop_na(hmeq)
# Standardize the columns LOAN and VALUE
hmeqStand - # Your code here
# Normalize the columns LOAN and VALUE
hmeqNorm - # Your code here
# Print the summaries of the data frames hmeqStand and hmeqNorm
print("Summary of standardized data:")
# Your code here
print("Summary of normalized data:")
# Your code here
 R Coding - Instructions - The hmeq_small dataset contains information on

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!