Data Manipulation With Dplyr — Part 2 MCQs with Explanations
Practice high-yield Programming & Software Development MCQs on Data Manipulation With Dplyr — Part 2 with worked academic solutions for FPSC, PPSC, NTS, NITB, PTS.
Questions
40
Difficulty Level
Exam-Level
Target Exams
FPSC, PPSC, NTS...
Estimated Time
48 mins
Exam-Level FPSC PPSC NTS NITB PTS
Verified for Commission Syllabus • Oct 14, 2026
40
Verified Practice Questions
Interactive test mode with detailed academic worked solutions
Live Progress|0/40 answered
✓0 correct
✗0 wrong
0% score
🎉 Set complete! All 40 questions answered.
Question 1 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
How do you rename a column named old_name to new_name in dplyr?
Correct Answer: Option D — rename(vars(old_name = new_name))
Detailed Academic Explanation:
rename(vars(old_name = new_name)) is the correct answer to “How do you rename a column named old_name to new_name in dplyr”. This question is standard in competitive examination syllabi for Data Manipulation With Dplyr.
💡Key Conceptual Anchor:Data Manipulation With Dplyr
Question 2 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
In dplyr, what is the purpose of the transmute() function?
Correct Answer: Option A — Creates a new data frame with only the specified columns
Detailed Academic Explanation:
Creates a new data frame with only the specified columns is the correct answer to “In dplyr, what is the purpose of the transmute() function”. This question is standard in competitive examination syllabi for Data Manipulation With Dplyr.
💡Key Conceptual Anchor:Data Manipulation With Dplyr
Question 3 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
How do you calculate the percentage of total sales for each category in dplyr?
mutate(percentage_sales = sales / sum(sales) * 100) is the correct answer to “How do you calculate the percentage of total sales for each category in dplyr”. This question is standard in competitive examination syllabi for Data Manipulation With Dplyr.
💡Key Conceptual Anchor:Data Manipulation With Dplyr
Question 4 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the purpose of the pivot_longer() function in dplyr?
Correct Answer: Option A — Transforms wide data to long format
Detailed Academic Explanation:
Transforms wide data to long format is the correct answer to “What is the purpose of the pivot_longer() function in dplyr”. This question is standard in competitive examination syllabi for Data Manipulation With Dplyr.
💡Key Conceptual Anchor:Data Manipulation With Dplyr
Question 5 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
How do you filter rows where a specific variable is not equal to a given value using filter() in dplyr?
Correct Answer: Option A — filter(variable != value)
Detailed Academic Explanation:
filter(variable != value) is the correct answer to “How do you filter rows where a specific variable is not equal to a given value using filter() in dplyr”. This question is standard in competitive examination syllabi for Data Manipulation With Dplyr.
💡Key Conceptual Anchor:Data Manipulation With Dplyr
Question 6 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following is a plot to investigate the order in which observations were recorded?
Correct Answer: Option D — ggorder
Detailed Academic Explanation:
ggorder is the correct answer to “Which of the following is a plot to investigate the order in which observations were recorded”. This question is standard in competitive examination syllabi for Data Manipulation With Dplyr.
💡Key Conceptual Anchor:Data Manipulation With Dplyr
Question 7 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following creates fluctuation plot?
Correct Answer: Option B — ggmissing
Detailed Academic Explanation:
ggmissing is the correct answer to “Which of the following creates fluctuation plot”. This question is standard in competitive examination syllabi for Data Manipulation With Dplyr.
💡Key Conceptual Anchor:Data Manipulation With Dplyr
Question 8 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
How many functions exist for wrangling the data with dplyr package?
Correct Answer: Option B — seven
Detailed Academic Explanation:
seven is the correct answer to “How many functions exist for wrangling the data with dplyr package”. This question is standard in competitive examination syllabi for Data Manipulation With Dplyr.
💡Key Conceptual Anchor:Data Manipulation With Dplyr
Question 9 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
The profiler can be turned off by passing . . . . . . . . to Rprof().
Correct Answer: Option D — NULL
Detailed Academic Explanation:
NULL is the correct answer to “The profiler can be turned off by passing . . . . . . . . to Rprof().”. This question is standard in competitive examination syllabi for Data Manipulation With Dplyr.
💡Key Conceptual Anchor:Data Manipulation With Dplyr
Question 10 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
which of the following functions can be used to finely control the appearance of all lattice plots ?
Correct Answer: Option D — trellis.par.set()
Detailed Academic Explanation:
trellis.par.set() is the correct answer to “which of the following functions can be used to finely control the appearance of all lattice plots”. This question is standard in competitive examination syllabi for Data Manipulation With Dplyr.
💡Key Conceptual Anchor:Data Manipulation With Dplyr
Question 11 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
. . . . . . . . function is used to simulate binary random variables.
Correct Answer: Option B — rbinom()
Detailed Academic Explanation:
rbinom() is the correct answer to “. . . . . . . . function is used to simulate binary random variables.”. This question is standard in competitive examination syllabi for Data Manipulation With Dplyr.
💡Key Conceptual Anchor:Data Manipulation With Dplyr
Question 12 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
. . . . . . . . display contours of a 3d surface in 2d.
Correct Answer: Option B — geom_contour
Detailed Academic Explanation:
geom_contour is the correct answer to “. . . . . . . . display contours of a 3d surface in 2d.”. This question is standard in competitive examination syllabi for Data Manipulation With Dplyr.
💡Key Conceptual Anchor:Data Manipulation With Dplyr
Question 13 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
. . . . . . . . modify a ggplot or theme object by adding on new components.
Correct Answer: Option A — +.gg
Detailed Academic Explanation:
+.gg is the correct answer to “. . . . . . . . modify a ggplot or theme object by adding on new components.”. This question is standard in competitive examination syllabi for Data Manipulation With Dplyr.
💡Key Conceptual Anchor:Data Manipulation With Dplyr
Question 14 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
How many functions exist for tidying the data?
Correct Answer: Option C — three
Detailed Academic Explanation:
three is the correct answer to “How many functions exist for tidying the data”. This question is standard in competitive examination syllabi for Data Manipulation With Dplyr.
💡Key Conceptual Anchor:Data Manipulation With Dplyr
Question 15 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
. . . . . . . . uses regex groups instead of a splitting pattern or position.
Correct Answer: Option C — separate()
Detailed Academic Explanation:
separate() is the correct answer to “. . . . . . . . uses regex groups instead of a splitting pattern or position.”. This question is standard in competitive examination syllabi for Data Manipulation With Dplyr.
💡Key Conceptual Anchor:Data Manipulation With Dplyr
Question 16 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
. . . . . . . . generate aesthetic mappings that describe how variables in the data.
Correct Answer: Option C — aes
Detailed Academic Explanation:
aes is the correct answer to “. . . . . . . . generate aesthetic mappings that describe how variables in the data.”. This question is standard in competitive examination syllabi for Data Manipulation With Dplyr.
💡Key Conceptual Anchor:Data Manipulation With Dplyr
Question 17 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
If I want to save a plot to a PDF file, which of the following is a correct way of doing that?
Correct Answer: Option A — Construct the plot on the screen device and then copy it to a PDF file with dev.copy2pdf()
Detailed Academic Explanation:
Construct the plot on the screen device and then copy it to a PDF file with dev.copy2pdf() is the correct answer to “If I want to save a plot to a PDF file, which of the following is a correct way of doing that”. This question is standard in competitive examination syllabi for Data Manipulation With Dplyr.
💡Key Conceptual Anchor:Data Manipulation With Dplyr
Question 18 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following is an example of a vector graphics device in R?
Correct Answer: Option D — SVG
Detailed Academic Explanation:
SVG is the correct answer to “Which of the following is an example of a vector graphics device in R”. This question is standard in competitive examination syllabi for Data Manipulation With Dplyr.
💡Key Conceptual Anchor:Data Manipulation With Dplyr
Question 19 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
You can time . . . . . . . . expressions by wrapping them in curly braces within the call to system.time().
Correct Answer: Option B — longer
Detailed Academic Explanation:
longer is the correct answer to “You can time . . . . . . . . expressions by wrapping them in curly braces within the call to system.time().”. This question is standard in competitive examination syllabi for Data Manipulation With Dplyr.
💡Key Conceptual Anchor:Data Manipulation With Dplyr
Question 20 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
. . . . . . . . produces box-and-whisker plots.
Correct Answer: Option D — bwplot
Detailed Academic Explanation:
bwplot is the correct answer to “. . . . . . . . produces box-and-whisker plots.”. This question is standard in competitive examination syllabi for Data Manipulation With Dplyr.
💡Key Conceptual Anchor:Data Manipulation With Dplyr
Question 21 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
. . . . . . . . is used for relative sizing of theme elements.
Correct Answer: Option A — rel
Detailed Academic Explanation:
rel is the correct answer to “. . . . . . . . is used for relative sizing of theme elements.”. This question is standard in competitive examination syllabi for Data Manipulation With Dplyr.
💡Key Conceptual Anchor:Data Manipulation With Dplyr
Question 22 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
How many methods exist for normalizing the data?
Correct Answer: Option B — two
Detailed Academic Explanation:
two is the correct answer to “How many methods exist for normalizing the data”. This question is standard in competitive examination syllabi for Data Manipulation With Dplyr.
💡Key Conceptual Anchor:Data Manipulation With Dplyr
Question 23 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
. . . . . . . . generate random Poisson variates with a given rate.
Correct Answer: Option D — rpois
Detailed Academic Explanation:
rpois is the correct answer to “. . . . . . . . generate random Poisson variates with a given rate.”. This question is standard in competitive examination syllabi for Data Manipulation With Dplyr.
💡Key Conceptual Anchor:Data Manipulation With Dplyr
Question 24 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
. . . . . . . . is a systematic way to examine how much time is spent in different parts of a program.
Correct Answer: Option A — Profiling
Detailed Academic Explanation:
Profiling is the correct answer to “. . . . . . . . is a systematic way to examine how much time is spent in different parts of a program.”. This question is standard in competitive examination syllabi for Data Manipulation With Dplyr.
💡Key Conceptual Anchor:Data Manipulation With Dplyr
Question 25 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
. . . . . . . . is the most common probability distribution to work with.
Correct Answer: Option A — Gaussian
Detailed Academic Explanation:
Gaussian is the correct answer to “. . . . . . . . is the most common probability distribution to work with.”. This question is standard in competitive examination syllabi for Data Manipulation With Dplyr.
💡Key Conceptual Anchor:Data Manipulation With Dplyr
Question 26 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
. . . . . . . . is used to determine what is plotted for each group.
Correct Answer: Option C — panel.superpose
Detailed Academic Explanation:
panel.superpose is the correct answer to “. . . . . . . . is used to determine what is plotted for each group.”. This question is standard in competitive examination syllabi for Data Manipulation With Dplyr.
💡Key Conceptual Anchor:Data Manipulation With Dplyr
Question 27 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following is a principle of analytic graphics?
Correct Answer: Option D — Show causality, mechanism, explanation
Detailed Academic Explanation:
Show causality, mechanism, explanation is the correct answer to “Which of the following is a principle of analytic graphics”. This question is standard in competitive examination syllabi for Data Manipulation With Dplyr.
💡Key Conceptual Anchor:Data Manipulation With Dplyr
Question 28 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Parallel processing is done via . . . . . . . . package can make the elapsed time smaller than the user time.
Correct Answer: Option A — parallel
Detailed Academic Explanation:
parallel is the correct answer to “Parallel processing is done via . . . . . . . . package can make the elapsed time smaller than the user time.”. This question is standard in competitive examination syllabi for Data Manipulation With Dplyr.
💡Key Conceptual Anchor:Data Manipulation With Dplyr
Question 29 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following R code? > pnorm(2)
Correct Answer: Option A — 0.9772499
Detailed Academic Explanation:
0.9772499 is the correct answer to “What will be the output of the following R code? > pnorm(2)”. This question is standard in competitive examination syllabi for Data Manipulation With Dplyr.
💡Key Conceptual Anchor:Data Manipulation With Dplyr
xyplot is the correct answer to “. . . . . . . . produces bivariate scatterplots or time-series plots.”. This question is standard in competitive examination syllabi for Data Manipulation With Dplyr.
💡Key Conceptual Anchor:Data Manipulation With Dplyr
Question 31 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following draws plot on current graphics device?
Correct Answer: Option C — print.ggplot
Detailed Academic Explanation:
print.ggplot is the correct answer to “Which of the following draws plot on current graphics device”. This question is standard in competitive examination syllabi for Data Manipulation With Dplyr.
💡Key Conceptual Anchor:Data Manipulation With Dplyr
Question 32 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following is a differentiation related aesthetic?
Correct Answer: Option C — aes_linetype_size_shape
Detailed Academic Explanation:
aes_linetype_size_shape is the correct answer to “Which of the following is a differentiation related aesthetic”. This question is standard in competitive examination syllabi for Data Manipulation With Dplyr.
💡Key Conceptual Anchor:Data Manipulation With Dplyr
Question 33 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following R code? > x <- rnorm(10) > summary(x)
Correct Answer: Option C — Min. 1st Qu. Median Mean 3rd Qu. Max. 18.09 19.75 21.22 20.74 21.77 22.20
Detailed Academic Explanation:
Min. 1st Qu. Median Mean 3rd Qu. Max. 18.09 19.75 21.22 20.74 21.77 22.20 is the correct answer to “What will be the output of the following R code? > x <- rnorm(10) > summary(x)”. This question is standard in competitive examination syllabi for Data Manipulation With Dplyr.
💡Key Conceptual Anchor:Data Manipulation With Dplyr
Question 34 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following function actually fits the linear model?
Correct Answer: Option C — lm.fit()
Detailed Academic Explanation:
lm.fit() is the correct answer to “Which of the following function actually fits the linear model”. This question is standard in competitive examination syllabi for Data Manipulation With Dplyr.
💡Key Conceptual Anchor:Data Manipulation With Dplyr
Question 35 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
. . . . . . . . generate aesthetic mappings from a string.
Correct Answer: Option C — aes_string
Detailed Academic Explanation:
aes_string is the correct answer to “. . . . . . . . generate aesthetic mappings from a string.”. This question is standard in competitive examination syllabi for Data Manipulation With Dplyr.
💡Key Conceptual Anchor:Data Manipulation With Dplyr
stripplot is the correct answer to “. . . . . . . . produces one-dimensional scatterplots.”. This question is standard in competitive examination syllabi for Data Manipulation With Dplyr.
💡Key Conceptual Anchor:Data Manipulation With Dplyr
Question 37 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
. . . . . . . . create a complete ggplot appropriate to a particular data type.
Correct Answer: Option A — autoplot
Detailed Academic Explanation:
autoplot is the correct answer to “. . . . . . . . create a complete ggplot appropriate to a particular data type.”. This question is standard in competitive examination syllabi for Data Manipulation With Dplyr.
💡Key Conceptual Anchor:Data Manipulation With Dplyr
Question 38 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
. . . . . . . . grammar makes a clear distinction between your data and what gets displayed on the screen or page.
Correct Answer: Option B — ggplot2
Detailed Academic Explanation:
ggplot2 is the correct answer to “. . . . . . . . grammar makes a clear distinction between your data and what gets displayed on the screen or page.”. This question is standard in competitive examination syllabi for Data Manipulation With Dplyr.
💡Key Conceptual Anchor:Data Manipulation With Dplyr
Question 39 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Annotation of plots in any plotting system involves adding points, lines, or text to the plot, in addition to customizing axis labels or adding titles. Different plotting systems have different sets of functions for annotating plots in this way. Which of the following functions can be used to annotate the panels in a multi-panel lattice plot?
Correct Answer: Option B — panel.abline()
Detailed Academic Explanation:
panel.abline() is the correct answer to “Annotation of plots in any plotting system involves adding points, lines, or text to the plot, in addition to customizing axis labels or adding titles. Different plotting systems have different sets of functions for annotating plots in this way. Which of the following functions can be used to annotate the panels in a multi-panel lattice plot”. This question is standard in competitive examination syllabi for Data Manipulation With Dplyr.
💡Key Conceptual Anchor:Data Manipulation With Dplyr
Question 40 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following R code? > set.seed(10) > x <- rbinom(100, 1, 0.5) > str(x)
Correct Answer: Option A — int [1:100] 1 0 0 1 0 0 0 0 1 0 ...
Detailed Academic Explanation:
int [1:100] 1 0 0 1 0 0 0 0 1 0 ... is the correct answer to “What will be the output of the following R code? > set.seed(10) > x <- rbinom(100, 1, 0.5) > str(x)”. This question is standard in competitive examination syllabi for Data Manipulation With Dplyr.
💡Key Conceptual Anchor:Data Manipulation With Dplyr
✓Link copied to clipboard
Continue Your Practice
Advance Html — Part 1
Master the next curriculum module with 40 exam-standard MCQs.
💡Examiner's Advisory for Programming & Software Development
In competitive commission exams (FPSC, PPSC, KPPSC, SPSC, CSS, PMS), questions are frequently phrased with distractor options designed to catch rote learners. Whenever you answer an MCQ, read the Detailed Academic Explanation and Conceptual Anchor to understand why the remaining options are incorrect.