How to visualize data with Highcharter: exercises
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
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”.
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.
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.