304 North Cardinal St.
Dorchester Center, MA 02124

# Data Visualization with R Quiz Answers – Cognitive Class

## Get Data Visualization with R Quiz Answers

“A picture is worth a thousand words”. We are all familiar with this expression. It especially applies when trying to explain the insight obtained from the analysis of increasingly large data sets. Data visualization plays an essential role in the representation of both small and large scale data.

One of the key skills of a data scientist is the ability to tell a compelling story, visualizing data and findings in an approachable and stimulating way. Learning how to leverage a software tool to visualize data will also enable you to extract information, better understand the data, and make more effective decisions.

The main goal of this course is to teach you how to take data that at first glance has little meaning and present that data in a form that makes sense to people. Various techniques have been developed for presenting data visually but in this course, we will be using the open source language R.

Enroll on Cognitive Class

Module 1 – Basic Visualization Tools

Question: 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: 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: 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

Module 2 – Basic Visualization Tools Continued

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

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

Question: 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: Which parameter out of the following represents the Confidence Interval in Regression?

• confidence_interval
• se
• ci
• Im

Module 3 – Specialized Visualization Tools

Question: 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: >> 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: 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

Module 4 – How to create Maps

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

• leaflet
• None of the options are correct

Question: 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: ___________ method is used to publish a tile layer on the map.

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

Module 5 – How to build interactive web pages

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

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

Question: 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: >> 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

Final Exam

Question: 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 correct

Question: 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: 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: 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: 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: 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: 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: 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: 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”)
• None of the options are correct

Question: 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: Select the correct option to create a WordCloud that is centered?

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

Question: 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: 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: ___________ can be used to adjust the size of Waffle Charts

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

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

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

Question: 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: 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: Which function gives an object that represents an empty world map

• leaflet
• All the options above are correct

Question: 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: Which function is used to create display of shiny app ?

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

### Conclusion:

We hope you know the correct answers to Data Visualization with R If Queslers helped you to find out the correct answers then make sure to bookmark our site for more Course Quiz Answers.

If the options are not the same then make sure to let us know by leaving it in the comments below.

##### Course Review:

In our experience, we suggest you enroll in this and gain some new skills from Professionals completely free and we assure you will be worth it.

This course is available on Cognitive Class for free, if you are stuck anywhere between quiz or graded assessment quiz, just visit Queslers to get all Quiz Answers and Coding Solutions.

More Courses Quiz Answers >>

Building Cloud Native and Multicloud Applications Quiz Answers

Accelerating Deep Learning with GPUs Quiz Answers

Blockchain Essentials Cognitive Class Quiz Answers