In RMarkdown, r chunks can take various options. A brief outline of these options are as follows:
# Read the data
df <- read.csv("data/WestRoxbury.csv")
t(t(names(df))) ##display column names in a user friendly manner
##       [,1]         
##  [1,] "TOTAL.VALUE"
##  [2,] "TAX"        
##  [3,] "LOT.SQFT"   
##  [4,] "YR.BUILT"   
##  [5,] "GROSS.AREA" 
##  [6,] "LIVING.AREA"
##  [7,] "FLOORS"     
##  [8,] "ROOMS"      
##  [9,] "BEDROOMS"   
## [10,] "FULL.BATH"  
## [11,] "HALF.BATH"  
## [12,] "KITCHEN"    
## [13,] "FIREPLACE"  
## [14,] "REMODEL"
names(df)[3]<- "LOT.SIZE"  #change the column name if so desired
names(df) <- tolower(names(df)) #change to lowercase if so desired
dim(df) #Show the number of rows and columns
## [1] 5802   14
head(df, n = 3)
##   total.value  tax lot.size yr.built gross.area living.area floors rooms
## 1       344.2 4330     9965     1880       2436        1352      2     6
## 2       412.6 5190     6590     1945       3108        1976      2    10
## 3       330.1 4152     7500     1890       2294        1371      2     8
##   bedrooms full.bath half.bath kitchen fireplace remodel
## 1        3         1         1       1         0    None
## 2        4         2         1       1         0  Recent
## 3        4         1         1       1         0    None

Box plots for quantitative variables

Fig. 1.1

Fig. 1.1


Histograms

Fig. 1.2

Fig. 1.2


Scatter plots exploring associations

## <ScaleContinuousPosition>
##  Range:  
##  Limits:    0 --    1
Fig. 1.3

Fig. 1.3


Bar charts

Fig. 1.4

Fig. 1.4


Heat map showing pairwise correlations

The heat map shows pairwise correlations between all quantitative variables in this dataset.
Fig. 1.5

Fig. 1.5

Parallel Coordinate Plots

Parallel Coordinate plot is useful to show the variation of several quantitative columns for different categories. In this example, I have created a subset of houses which are recently remodelled, single floor with fewer than 10 rooms. The coordinate plot shows the variation in terms of the number of bedrooms for each house in this subset. Altogether there are 144 houses in this subset.The code for creating these plots have been adapted from this site

Mosaic Plot

Let us create a mosaic plot that visualizes counts in the contingency table having remodel and floors as its dimensions.

##         floors
## remodel     1  1.5    2  2.5    3
##   None   1246  560 2490   48    2
##   Old     112   89  361   18    1
##   Recent  147  124  564   39    1

Cleveland Dot Plot using Cereals dataset

In order to show the usefulness of Cleveland dot plot, I will use “Cereals” data set.