Data Visualization with R Cognitive Class Answers (Module Quizzes + Final Exam)

Last updated: 15 November 2026 · First published: 3 August 2020
In this guide
  1. Data Visualization with R quiz and final exam answers
  2. Get Certificate: Data Visualization with R Cognitive Class Exam Quiz Answers
  3. Data Visualization with R Cognitive Class Certification Answers
  4. Module 1 – Basic Visualization Tools
  5. Module 2 – Basic Visualization Tools Continued
  6. Module 3 – Specialized Visualization Tools
  7. Module 4 – How to create Maps
  8. Module 5 – How to build interactive web pages
  9. Data Visualization with R Final Exam Answers – Cognitive Class
  10. Introduction to Data Visualization with R
  11. More questions from other versions of this course
  12. Frequently asked questions

Data Visualization with R quiz and final exam answers

These are the answers to the module quizzes and final exam of Data Visualization with R, a free course from IBM’s Cognitive Class (IBM Skills Network). Use them to check your understanding as you work through the course.

Course at a glance

  • Provider: Cognitive Class (IBM Skills Network)
  • Cost: Free
  • Credential: IBM digital badge after passing the final exam (check the course page for current requirements)
  • Official course: cognitiveclass.ai
  • Answers reviewed: November 2026

IBM sometimes updates its question banks and retires older courses. If a question here doesn’t match your quiz, leave a comment and we’ll update it.

Data Visualization with R Cognitive Class Certification Answers

Data Visualization with R Cognitive Class Answers

Question 1: Choose the correct code from the following options to install the ggplot2 library in R.

  • install.packages(ggplot2)
  • install.package(“ggplot2”)
  • install.packages(“ggplot2”)
  • install.package(ggplot2)

Question 2: Select the correct code that provides numerical values to different segments of the pie chart?

  • coord_polar(theta=’y’)
  • coord_polar(‘y’)
  • theta = coord_polar(‘y’)
  • coord_polar()

Question 3: Select the correct code from the following options to remove the color of the bars in the histogram?

  • xlab = 0
  • alpha = I(0)
  • binwidth = 0
  • geom = 0

Question 1: Select the correct methods used to create a scatterplot in R?

  • scatterplot3d()
  • scatterplot()
  • qplot()
  • plot()
  • All the above options are

Question 2: Select the correct parameter used to change the line width in a line graph using the geom_line() method ?

  • line_size
  • size
  • line_width
  • width

Question 3: Which parameter out of the following represents the Confidence Interval in Regression?

  • confidence_interval
  • se
  • ci
  • lm

Question 1: Select the correct option for the values of Median, Lower whisker, Upper whisker, First quartile, Third quartile for the dataset : 3, 5, 7, 8, 12, 13, 14, 18, 21?

  • 33, 2, 5, 12, 18
  • 6, 2, 22, 7, 2
  • 12, 4, 2, 3, 17
  • 12, 3, 21, 6, 16

Question 2: >>True or False : To create waffle charts in R, we use ggplot library which is used for graphs and also waffle library.

  • True
  • False

Question 3: When working with Radar Charts in R, what is the correct code used to suppress the warnings generated?

  • (warn = -1)
  • (warn = 1)
  • options(warn = -1)
  • None of the options are correct

Question 1: Which function gives an object that represents an empty world map

  • addMarkers
  • addTiles
  • leaflet
  • None of the options are correct

Question 2: What is the use of the method addTiles() in R?

  • To divide map in tiles.
  • To zoom in the map to see different countries and streets in detail.
  • To create tiles view of map.
  • All the options above are correct

Question 3: ___________ method is used to publish a tile layer on the map.

  • leaf()
  • leaflet()
  • addTiles()
  • None of the above options are correct

Question 1: Which function is used to create the display of shiny app ?

  • display()
  • output functions
  • fluidPage()
  • input functions

Question 2: Which argument is used to position sliderbar on the right hand side in shiny app?

  • align=”right”
  • position=”right”
  • position = “rightalign”
  • sliderLayout(position=”right”)

Question 3: >>What does the ui.R file in R contain ?

  • inputs for server.R
  • layout and appearance of app.
  • instructions to build output object.
  • All the above options are correct

Question 1: Which of the following options indicate the features that make R suitable for Data Visualizations

  • R is a free and open source tool
  • Built for statistical computing
  • Visualization Tools
  • All the options above are

Question 2: if(“ggplot2” %in% rownames(installed.packages()) == FALSE) {install.packages(“ggplot2”)}library(ggplot2) Please select the correct explanation for the code from the following options

  • Check if “ggplot2” library is already installed into R, if not then install it and load it into R environment
  • Load the “ggplot2”library into R environment
  • Install and load the “ggplot2” library into R environment
  • Install the “ggplot2” library into R

Question 3: We want to create a Bar Graph with black filled bars, x and y axis labels as Cylinders and Number of cars respectively and outline color of bars as Red. Choose the correct code block from below which will create the desired graph.

  • qplot(mtcars$cyl, geom = “bar”, fill = I(“black”), xlab = “Cylinders”, ylab = “Number of Cars”, colour = I(“red”))
  • qplot(mtcars$cyl, geom = “histogram”, fill = I(“black”), xlab = “Cylinders”, ylab = “Number of Cars”, colour=I(“red”))
  • qplot(mtcars$cyl, fill = I(“black”), xlab = “Cylinders”, ylab=”Number of Cars”, outline=I(“red”)
  • None of the options are correct

Question 4: Choose the correct parameter which will define the width of the bars in a Histogram.

  • binwidth
  • barWidth
  • bar_width(value)
  • width
  • None of the options are correct

Question 5: A pie chart in ggplot2 is a transformed stacked bar plot. Select the correct function from the following options to convert a stacked bar plot into a pie chart?

  • pieChart (theta=’y’)
  • coord_polar(theta=’y’)
  • transform(theta=’y’)
  • None of the above options are correct

Question 6: Let’s assume we have the mtcars dataset and we want to create a Scatter Plot by using mpg and wt columns of this dataset. Select the correctcode from the options below which can create the plot for us with red colored points.

  • ggplot(mtcars,aes(x=mpg,y=wt)) + geom_point()
  • ggplot(mtcars,aes(x=mpg,y=wt)) + geom_point(shape=19, colour=”red”)
  • ggplot(mtcars,aes(x=mpg,y=wt)) + geom_point(shape=19, “blue”)
  • None of the options above are correct

Question 7: True or False: It is possible plot more than one line at a time in the same graph using the ggplot() method

  • False
  • True

Question 8: Choose the correct statement from the following options

  • se parameter is used to display confidence interval
  • There is no term Confidence Interval in Regression
  • If you want to display confidence interval then either just ignore the se attribute, or set it to TRUE
  • None of above options are correct

Question 9: Suppose we want to download a .csv file from the link below, https://ibm.box.com/shared/static/cmid70rpa7xe4ocitcga1bve7r0kqnia.csv and store it with name my_data.csv in “/resources/data/” folder. Select the correct code from the options below

  • file(“https://ibm.box.com/shared/static/cmid70rpa7xe4ocitcga1bve7r0kqnia.csv”, “/resources/data/my_data.csv”)
  • download.file(“https://ibm.box.com/shared/static/cmid70rpa7xe4ocitcga1bve7r0kqnia.csv”, destfile = “/resources/data/my_data.csv”)
  • download(“https://ibm.box.com/shared/static/cmid70rpa7xe4ocitcga1bve7r0kqnia.csv”, destfile = “/resources/data/my_data.csv”)
  • None of the options are correct

Question 10: Select the correct format from the following options to create a word cloud with a minimum frequency value 1 and maximum words 200?

  • wordcloud(words = data, freq = frequency, min.freq = 1, max.words=200)
  • wordcloud(data, frequency, minimun= 1, max.words=200)
  • wordcloud(freq = frequency, min.freq = 1, maxWords=200)
  • wordcloud(words = data, freq = frequency, min.freq = 1)

Question 11: Select the correct option to create a WordCloud that is centered?

  • order = FALSE
  • random.order = TRUE
  • random.order = FALSE
  • random = TRUE

Question 12: dplyr and Scales libraries in a Radar Chart are used for?

  • filtering the dataset
  • provides convenient viewing and utility functions
  • pipe operations and to determine labels respectively
  • None of the options are correct

Question 13: Which method is used to avoid displaying warnings, generated while Creating a Radar Chart?

  • options(warns=-1)
  • warns(-1)
  • options(warn=-1)
  • warnings(-1)

Question 14: ___________ can be used to adjust the size of Waffle Charts

  • kernel
  • IRkernel
  • Ikernel
  • None of the options are correct

Question 15: >> Which of the following parameters are used to create waffle charts in R?

  • colors
  • rows
  • title
  • xlab
  • All the options above are

Question 16: Choose the correct method to create a Box Plot in R

  • ggplot(df) + geom_boxplot()
  • ggplot(df, aes(x=label, y=value))
  • ggplot(df, aes(x=label, y=value)) + geom_boxplot()
  • None of the options are correct

Question 17: What is the term used to indicate the difference between the first and third quartiles?

  • lower whisker and upper whisker.
  • first quartile
  • third quartile
  • Interquartile Range

Question 18: Which function gives an object that represents an empty world map

  • addMarkers
  • addTiles
  • leaflet
  • All the options above are correct

Question 19: What is the use of the method addTiles() in R?

  • To divide map in tiles.
  • To zoom in the map to see different countries and streets in detail.
  • To create tiles view of map.
  • All the options above are correct

Question 20: Which function is used to create display of shiny app ?

  • display()
  • output functions
  • fluidPage()
  • input functions

Introduction to Data Visualization with R

R is a powerful programming language and environment specifically designed for statistical computing and graphics. It’s widely used by data analysts, statisticians, and researchers for data visualization due to its extensive collection of packages for statistical graphics and its flexibility in creating high-quality visualizations.

Here’s a basic overview to get you started:

Installing R and RStudio:

  1. Install R: Go to the R Project website and download the latest version of R for your operating system. Follow the installation instructions.
  2. Install RStudio (Optional but Recommended): RStudio is an integrated development environment (IDE) for R that provides a more user-friendly interface. You can download it from the RStudio website and install it on your computer.

Basics of Data Visualization in R:

  1. Loading Data: Before you can visualize data, you need to load it into R. You can do this using functions like read.csv() for CSV files, read.table() for tabular data, or readRDS() for R Data Files.
  2. Exploring Data: Once your data is loaded, it’s essential to explore it to understand its structure and contents. Functions like head(), summary(), and str() are helpful for this purpose.
  3. Choosing the Right Package: R offers several packages for data visualization. The most popular one is ggplot2, but there are others like plotly, lattice, and ggvis. Each package has its strengths and weaknesses, so it’s essential to choose the one that best suits your needs.
  4. Creating Basic Plots with ggplot2: ggplot2 follows the grammar of graphics, which provides a structured way to create visualizations.
  5. Customizing Plots: ggplot2 allows for extensive customization of plots. You can modify the appearance of points, lines, axes, labels, and more using various geom_* layers and theme() options.
  6. Saving Plots: Once you’ve created a plot, you can save it as an image file using functions like ggsave().

Further Learning:

  • Online Resources: Websites like DataCamp, Coursera, and YouTube offer numerous tutorials and courses on data visualization with R.
  • Books: Books like “ggplot2: Elegant Graphics for Data Analysis” by Hadley Wickham and “R for Data Science” by Garrett Grolemund and Hadley Wickham are excellent resources for learning data visualization in R.
  • Practice: The best way to learn is by doing. Practice creating different types of plots with different datasets to gain proficiency.

Mastering data visualization takes time and practice, so don’t get discouraged if things seem challenging at first. Keep experimenting and learning, and you’ll soon become proficient in creating insightful visualizations with R!

More questions from other versions of this course

Students have also reported these questions for this course. They may come from an earlier or later version of the quiz.

Question 1: R is a powerful programming language and environment for statistical computing and graphics. It’s widely used in academia, research, and industry for data analysis, visualization, and statistical modeling.
Here’s a brief overview of how you can get started with data visualization in R:

  • Install R and RStudio: Before you can start visualizing data, you need to install R and RStudio. R is the programming language itself, while RStudio is an integrated development environment (IDE) that provides a more user-friendly interface for working with R. Both are free and can be downloaded from their respective websites.
  • Load Data: Once you have R and RStudio installed, you can begin by loading your data into R. R can handle various types of data formats, such as CSV, Excel, or databases. You can use functions like read.csv() or read_excel() from the readr or readxl packages to import your data into R.
  • Explore Your Data: Before creating visualizations, it’s essential to explore your data to understand its structure, summary statistics, and relationships between variables. R provides various functions for data manipulation and exploration, such as summary(), str(), head(), tail(), and many more.
  • Choose the Right Visualization: Selecting the appropriate type of visualization depends on the nature of your data and the insights you want to convey. R offers a wide range of packages for creating different types of plots, including scatter plots, bar plots, histograms, boxplots, line graphs, heatmaps, and more. Some popular visualization packages in R include ggplot2, plotly, ggvis, lattice, and ggplotly.
  • Create Visualizations: Once you’ve decided on the type of visualization you want to create, you can use R to generate it. For example, if you’re using ggplot2, you can start by creating a plot object using the ggplot() function and then adding layers to customize the plot using various geoms (geometric objects) and aesthetics.
  • Customize Your Visualizations: R provides extensive options for customizing your visualizations, including changing colors, labels, titles, axes, legends, and more. You can use additional functions and arguments to modify the appearance and layout of your plots to make them more informative and visually appealing.
  • Save and Share Your Visualizations: Once you’ve created your visualizations, you can save them as image files (e.g., PNG, JPEG, PDF) or interactive web graphics (e.g., HTML, JavaScript) using R. You can also embed your visualizations in reports, presentations, or web applications to share your insights with others.

Frequently asked questions

Is Data Visualization with R on Cognitive Class free?

Yes. Cognitive Class courses are free; you only need to create a free account.

Do I get a certificate?

Cognitive Class awards an IBM digital badge (issued through Credly) when you pass the final exam with the required score. You can add it to LinkedIn and your résumé.

Leave a Comment