Question: how do I make R markdown and what to put in it to display these thing for my code below: # Step 1 : Read
how do I make R markdown and what to put in it to display these thing for my code below:
# Step : Read and Load Data
housingdata read.csvHousingcsv stringsAsFactors TRUE
# Print first observations to verify
headhousingdata,
price area bedrooms bathrooms stories mainroad guestroom basement hotwaterheating
yes no no no
yes no no no
yes no yes no
yes no yes no
yes yes yes no
yes no yes no
yes no no no
yes no no no
yes yes yes no
yes yes no no
airconditioning parking prefarea furnishingstatus
yes yes furnished
yes no furnished
no yes semifurnished
yes yes furnished
yes no furnished
yes yes semifurnished
yes yes semifurnished
no no unfurnished
yes yes furnished
yes yes unfurnished
# Step : Subset Columns
housingdata housingdata cprice "area", "bedrooms", "stories", "basement", "furnishingstatus"
# Step : Determine Variable Types
strhousingdata
'data.frame': obs. of variables:
$ price : int
$ area : int
$ bedrooms : int
$ stories : int
$ basement : Factor w levels no"yes":
$ furnishingstatus: Factor w levels "furnished","semifurnished",..:
# Step : Summary Statistics
summaryhousingdata
price area bedrooms stories basement
Min. : Min. : Min. : Min. : no :
st Qu: st Qu: st Qu:st Qu: yes:
Median : Median : Median : Median :
Mean : Mean : Mean : Mean :
rd Qu: rd Qu: rd Qu:rd Qu:
Max. : Max. : Max. : Max. :
furnishingstatus
furnished :
semifurnished:
unfurnished :
# Step : Create Bar Charts for Factors
# Bar chart for basement
barplottablehousingdata$basement main "Basement", xlab "Basement", ylab "Frequency"
# Bar chart for furnishingstatus
barplottablehousingdata$furnishingstatus main "Furnishing Status", xlab "Furnishing Status", ylab "Frequency"
# Step : Create Histograms
# Histogram for price
histhousingdata$price, main "Histogram of Price", xlab "Price"
# Histogram for area
histhousingdata$area, main "Histogram of Area", xlab "Area"
# Step : Create Scatter Plot
plothousingdata$area, housingdata$price, main "Scatter Plot of Price vs Area", xlab "Area", ylab "Price"
# Step : Subset Data
housingbasement housingdatahousingdata$basement "yes",
# Print first few lines
headhousingbasement
price area bedrooms stories basement furnishingstatus
yes semifurnished
yes furnished
yes furnished
yes semifurnished
yes furnished
yes furnished
# Step : Create Pie Chart
pietablehousingbasement$furnishingstatus main "Furnishing Status Distribution"
# Step : Read and Load the Data
housingdata read.csv<
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
