How to visualize data with Highcharter: exercises

[This article was first published on R-exercises, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

INTRODUCTION

Highcharter is a R wrapper for Highcharts javascript libray and its modules. Highcharts is very mature and flexible javascript charting library and it has a great and powerful API.

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 without looking at the answers. Then check the solutions to check your answers.

Exercise 1

Load the mpg dataset and create a basic scatterplot between variables of your choice.

Exercise 2

Group the scatterplot you just created by “class”.

Exercise 3

Use highchart() to create a basic column chart of your choice.

Exercise 4

Add title to the chart of exercise 3.

Exercise 5

Name the bars of your columnchart as years and replace “Series 1” with “Sales”.

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

  • Work extensively with the ggplot package and its functionality
  • Learn what visualizations exist for your specific use case
  • And much more

Exercise 6

Load the diamonds dataset, create a basic column chart and color it by “cut”.

Exercise 7

Create a columnchart of the “price” with color of your choice.

Exercise 8

Use forecast() on AirPassengers dataset in combination with hchart().

Exercise 9

Create a chloropleth map of the unemployemnt dataset with a colorAxis().

Exercise 10

Change the parameters of the legend with parameters of your choice.

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 about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

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)