Advanced R Programming for Data Analytics in Business Week 1 Answers Nptel
Are you looking for Advanced R Programming for Data Analytics in Business Week 1 Answers Nptel. All weeks solutions of this Swayam course are available here.
Table of Contents

Advanced R Programming for Data Analytics in Business Week 1 Answers (July-Dec 2025)
Course link: Click here
Question 1. In a boxplot created using ggplot, what does the top of the box represent?
a) Mean of the data
b) 90th percentile
c) Maximum value
d) 75th percentile (third quartile)
Question 2. You are using ggplot to plot a scatterplot between Bitcoin returns and S&P 500 returns. Which ggplot2 layer will add a regression line to your scatterplot?
a) geom_line(method = “lm”)
b) geom_smooth(method = “lm”)
c) geom_abline(method = “lm”)
d) geom_point(method = “lm”)
Question 3. Which R command will you use to get a quick look at the structure of a dataframe (DF) including dimensions, variable types, and few initial elements?
a) structure(DF)
b) summary(DF)
c) glimpse(returns_data)
d) head(returns_data)
Question 4. What is the correct way to install and then load the ‘dplyr’ package in R?
a) install.packages(“dplyr”) followed by load(“dplyr”)
b) library(dplyr) followed by install.packages(“dplyr”)
c) install.packages(“dplyr”) followed by library(dplyr)
d) import(“dplyr”) only
These are Advanced R Programming for Data Analytics in Business Week 1 Answers Nptel
Question 5. In R, what happens when you add two vectors of unequal lengths?
v1 <- c(1, 2, 3, 4, 5, 6)
v2 <- c(10, 20)
v1 + v2
a) Error: Vectors must be of equal length.
b) Only the first two elements are added.
c) v2 is recycled to match v1’s length.
d) NA values are added for the missing elements.
Question 6. Which R function is used to remove all rows with NA values from an entire data frame?
a) omit.na()
b) na.omit()
c) rm.na()
d) delete.na()
Question 7. Given a data frame df, how can you replace all NA values with 0?
a) df[is.na(df)] <- 0
b) df == NA <- 0
c) removeNA(df, value = 0)
d) df <- zero.na(df)
These are Advanced R Programming for Data Analytics in Business Week 1 Answers Nptel
Question 8. Your data contains rating outlooks for different countries. The rating variable is a factor variable (with three levels, namely, positive, negative, and stable). Which plot can best represent the frequency distribution of the three ratings?
a) Histogram
b) Barplot
c) XY scatter plot
d) Boxplot
Question 9. You are working with weekly gasoline price data and want to visualize the movement of prices over time. Which of the following plots best represents the evolution of prices over time?
a) XY plot, where X axis is time and Y is prices
b) XY plot, where X axis is price and Y is time
c) Histogram of prices
d) Boxplot of prices
Question 10. If you want to combine two data frames by a common column with all rows retained from both, which merge option should you use?
a) rbind(df1, df2, all = TRUE)
b) merge(df1, df2, all = TRUE)
c) cbind(df1, df2, all = TRUE)
d) reduce(df1, df2, all = TRUE)
These are Advanced R Programming for Data Analytics in Business Week 1 Answers Nptel