Skip to main content

Data Manipulation With Dplyr — Part 1 MCQs with Explanations

Practice high-yield Programming & Software Development MCQs on Data Manipulation With Dplyr — Part 1 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
Question 1 of 40
★ FPSC ★ PPSC

In dplyr, what function is used to select specific columns from a data frame?

Question 2 of 40
★ FPSC ★ PPSC

How do you filter rows in a dplyr data frame based on a specific condition using filter()?

Question 3 of 40
★ FPSC ★ PPSC

In dplyr, what does the arrange() function do?

Question 4 of 40
★ FPSC ★ PPSC

What function is used to create a new variable in a dplyr data frame based on existing variables?

Question 5 of 40
★ FPSC ★ PPSC

How do you perform a group-wise summary operation using dplyr's group_by() and summarize() functions?

Question 6 of 40
★ FPSC ★ PPSC

What is the purpose of the distinct() function in dplyr?

Question 7 of 40
★ FPSC ★ PPSC

In dplyr, what does the mutate() function do?

Question 8 of 40
★ FPSC ★ PPSC

How do you join two data frames based on a common column using dplyr's left_join()?

Question 9 of 40
★ FPSC ★ PPSC

In dplyr, what is the purpose of the %>% operator (pipe operator)?

Question 10 of 40
★ FPSC ★ PPSC

What is the role of the summarize() function in dplyr?

Question 11 of 40
★ FPSC ★ PPSC

In dplyr, how do you calculate the mean of a numeric variable named score for each group using summarize()?

Question 12 of 40
★ FPSC ★ PPSC

What function is used to rename columns in a dplyr data frame?

Question 13 of 40
★ FPSC ★ PPSC

In dplyr, how do you filter rows where a specific variable is not missing using filter()?

Question 14 of 40
★ FPSC ★ PPSC

How do you count the number of rows in a dplyr data frame?

Question 15 of 40
★ FPSC ★ PPSC

In dplyr, how do you select the top 5 rows based on a variable named value in descending order?

Question 16 of 40
★ FPSC ★ PPSC

What does the group_by() function do in dplyr?

Question 17 of 40
★ FPSC ★ PPSC

In dplyr, how do you select columns based on a partial name using the select() function?

Question 18 of 40
★ FPSC ★ PPSC

What function is used to filter rows based on multiple conditions in dplyr?

Question 19 of 40
★ FPSC ★ PPSC

How do you perform an inner join between two data frames in dplyr using inner_join()?

Question 20 of 40
★ FPSC ★ PPSC

In dplyr, how do you calculate the total count of observations in each group using summarize()?

Question 21 of 40
★ FPSC ★ PPSC

What is the purpose of the ungroup() function in dplyr?

Question 22 of 40
★ FPSC ★ PPSC

How do you select distinct values from a column named category in dplyr using distinct()?

Question 23 of 40
★ FPSC ★ PPSC

In dplyr, what does the slice() function do?

Question 24 of 40
★ FPSC ★ PPSC

What does the rename_all() function do in dplyr?

Question 25 of 40
★ FPSC ★ PPSC

How do you calculate the median of a numeric variable named price for each group in dplyr?

Question 26 of 40
★ FPSC ★ PPSC

In dplyr, how do you select columns that match a specific pattern using the select() function?

Question 27 of 40
★ FPSC ★ PPSC

What function is used to remove missing values from a dplyr data frame?

Question 28 of 40
★ FPSC ★ PPSC

In dplyr, how do you calculate the cumulative sum of a variable named sales within each group?

Question 29 of 40
★ FPSC ★ PPSC

How is the case_when() function used in dplyr?

Question 30 of 40
★ FPSC ★ PPSC

In dplyr, what does the slice_sample() function do?

Question 31 of 40
★ FPSC ★ PPSC

In dplyr, what is the purpose of the distinct() function when used with multiple columns?

Question 32 of 40
★ FPSC ★ PPSC

How do you create a new column total_price in dplyr that is the sum of two existing columns price1 and price2?

Question 33 of 40
★ FPSC ★ PPSC

What is the purpose of the filter() function in dplyr?

Question 34 of 40
★ FPSC ★ PPSC

How do you select columns from a dplyr data frame where the column names start with the letter 'a'?

Question 35 of 40
★ FPSC ★ PPSC

In dplyr, how do you calculate the sum and mean of a numeric variable named quantity for each group?

Question 36 of 40
★ FPSC ★ PPSC

What is the role of the left_join() function in dplyr?

Question 37 of 40
★ FPSC ★ PPSC

In dplyr, how do you filter rows where a specific variable is within a range using filter()?

Question 38 of 40
★ FPSC ★ PPSC

How do you count the number of distinct values in a column named category in dplyr?

Question 39 of 40
★ FPSC ★ PPSC

In dplyr, how do you filter rows based on multiple conditions using the AND logic?

Question 40 of 40
★ FPSC ★ PPSC

What does the desc() function do in dplyr?

✓ Link copied to clipboard
Continue Your Practice

Advance Html — Part 1

Master the next curriculum module with 40 exam-standard MCQs.

Next Practice Set →

💡 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.

More Modules in Programming & Software Development

View All →
📚

Study Guides

Topic summaries and syllabus breakdown

Explore Guides →
🎯

Complete Library

Search through 78,000+ verified MCQs

Browse Library →
📱

Mobile App

Offline mock tests and instant bookmarks

Get Mobile App →