iPlots exercises

July 4, 2017
By

(This article was first published on R-exercises, and kindly contributed to R-bloggers)

INTRODUCTION

iPlots is a package which provides interactive statistical graphics, written in Java. You can find many interesting plots such as histograms, barcharts, scatterplots, boxplots, fluctuation diagrams, parallel coordinates plots and spineplots. The amazing part is that all of these plots support querying, linked highlighting, color brushing, and interactive changing of parameters.

Before proceeding, please follow our short tutorial.

Look at the examples given and try to understand the logic behind them. Then try to solve the exercises below using R and without looking at the answers. Then check the solutions.
to check your answers.

Exercise 1

Install and call the packages iplots and MASS in your working environment and then attach the dataset “Cars93”.

Exercise 2

Create a mosaic plot of the variables “AirBags”, “Cylinders” and “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 created in Exercise 3. HINT: Use spineplot.

Exercise 5

See how the variable “Type” is ordered. HINT: Use levels().

Learn more about different visualization packages in the online course R: Complete Data Visualization Solutions. In this course you will learn how to:

  • Work extensively with different packages to visualize your data
  • Learn what visualizations exist for your specific use case
  • And much more

Exercise 6

Reverse the order of the variable “Type”, name it “Type2” and check the order of “Type2”. HINT: Use ordered() and levels().

Exercise 7

Plot the barcharts of “Type” and “Type2” and 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” by number of “Cylinders”. HINT: Use ibox().

To leave a comment for the author, please follow the link and comment on their blog: R-exercises.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Search R-bloggers


Sponsors

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)