INTRODUCTION
iPlots is a packet which provides interactive statistical graphics, written inwards Java. You tin uncovering many interesting plots such every bit histograms, barcharts, scatterplots, boxplots, fluctuation diagrams, parallel coordinates plots as well as spineplots. The amazing utilization is that all of these plots back upward querying, linked highlighting, color brushing, as well as interactive changing of parameters.
Before proceeding, delight follow our short tutorial.
Look at the examples given as well as displace to empathise the logic behind them. Then displace to solve the exercises below using R as well as without looking at the answers. Then banking concern represent the solutions.to banking concern represent your answers.
Look at the examples given as well as displace to empathise the logic behind them. Then displace to solve the exercises below using R as well as without looking at the answers. Then banking concern represent the solutions.to banking concern represent your answers.
Exercise 1
Install as well as telephone band the packages
iplots
and MASS
in your working environs as well as and thus attach the dataset “Cars93”. Exercise 2
Create a mosaic plot of the variables “AirBags”, “Cylinders” as well as “Origin” of the “Cars93” dataset. HINT: Use
imosaic()
. Exercise 3
Create a barchart of the variable “Fuel.tank.capacity” of the “Cars93” dataset. HINT: Use
ibar()
. Exercise 4
Get a spineplot of the barchart you lot created inwards Exercise 3. HINT: Use
spineplot
. Exercise 5
See how the variable “Type” is ordered. HINT: Use
levels()
. Exercise 6
Reverse the lodge of the variable “Type”, advert it “Type2” as well as banking concern represent the lodge of “Type2”. HINT: Use
ordered()
and levels()
. Exercise 7
Plot the barcharts of “Type” as well as “Type2” as well as spot the difference. HINT: Use
ibar()
. Exercise 8
Make a Parallel Coordinate Plot for all the continuous variables of “Cars93”. HINT: Use
ipcp()
. Exercise 9
Make a parallel boxplot for all “price” variables. HINT: Use
ibox()
. Exercise 10
Split the boxplot for “Wheelbase” past times set out of “Cylinders”. HINT: Use
ibox()
. _______________________________________
Below are the solutions to these iPlots exercises.
#################### # # # Exercise 1 # # # #################### install.packages("iplots") install.packages("MASS") library(iplots) library(MASS) data("Cars93") attach(Cars93) #################### # # # Exercise two # # # #################### library(iplots) library(MASS) data("Cars93") attach(Cars93) imosaic(data.frame(AirBags,Cylinders,Origin)) #################### # # # Exercise iii # # # #################### library(iplots) library(MASS) data("Cars93") attach(Cars93) ibar(Fuel.tank.capacity) #################### # # # Exercise iv # # # #################### library(iplots) library(MASS) data("Cars93") attach(Cars93) ibar(Fuel.tank.capacity,isSpine=T) #################### # # # Exercise v # # # #################### library(iplots) library(MASS) data("Cars93") attach(Cars93) levels(Type) #################### # # # Exercise half dozen # # # #################### library(iplots) library(MASS) data("Cars93") attach(Cars93) Type2 <- ordered(Type, c("Van", "Sporty","Small", "Midsize","Large","Compact")) levels(Type2) #################### # # # Exercise vii # # # #################### library(iplots) library(MASS) data("Cars93") attach(Cars93) Type2 <- ordered(Type, c("Van", "Sporty","Small", "Midsize","Large","Compact")) ibar(Type) ibar(Type2) #################### # # # Exercise 8 # # # #################### library(iplots) library(MASS) data("Cars93") attach(Cars93) ipcp(Cars93[c(4:8,12:15,17,19:25)]) #################### # # # Exercise ix # # # #################### library(iplots) library(MASS) data("Cars93") attach(Cars93) ibox(Cars93[4:6]) #################### # # # Exercise 10 # # # #################### library(iplots) library(MASS) data("Cars93") attach(Cars93) ibox(Wheelbase, Cylinders)
___________________________________
Sources:
http://www.r-exercises.com/2017/07/04/iplots-exercises-solutions/
http://www.r-exercises.com/2017/07/04/iPlots-exercises/