Skip to main content

Introduction To R Programming — Part 1 MCQs with Explanations

Practice high-yield Programming & Software Development MCQs on Introduction To R Programming — 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

What is the primary purpose of R programming language?

Question 2 of 40
★ FPSC ★ PPSC

In R, what does the function length() do?

Question 3 of 40
★ FPSC ★ PPSC

How is a comment denoted in R?

Question 4 of 40
★ FPSC ★ PPSC

What does the function install.packages() do in R?

Question 5 of 40
★ FPSC ★ PPSC

Which of the following is a correct variable name in R?

Question 6 of 40
★ FPSC ★ PPSC

What does RStudio provide for R programming?

Question 7 of 40
★ FPSC ★ PPSC

In R, how is a matrix created using the matrix() function?

Question 8 of 40
★ FPSC ★ PPSC

What is the purpose of the function Sys.Date() in R?

Question 9 of 40
★ FPSC ★ PPSC

Which of the following is a valid R data type?

Question 10 of 40
★ FPSC ★ PPSC

How is a data frame created in R?

Question 11 of 40
★ FPSC ★ PPSC

What does the R function read.csv() do?

Question 12 of 40
★ FPSC ★ PPSC

How do you assign a value to a variable in R?

Question 13 of 40
★ FPSC ★ PPSC

Which of the following operators is used for exponentiation in R?

Question 14 of 40
★ FPSC ★ PPSC

In R, what does the function help.start() do?

Question 15 of 40
★ FPSC ★ PPSC

What does the function summary() do in R?

Question 16 of 40
★ FPSC ★ PPSC

What does the R function seq(1, 10, by = 2) produce?

Question 17 of 40
★ FPSC ★ PPSC

How do you check the class of an object in R?

Question 18 of 40
★ FPSC ★ PPSC

What is the purpose of the R function rnorm(100, mean = 0, sd = 1)?

Question 19 of 40
★ FPSC ★ PPSC

Which operator is used for element-wise multiplication in R?

Question 20 of 40
★ FPSC ★ PPSC

In R, what is the purpose of the rep() function?

Question 21 of 40
★ FPSC ★ PPSC

How is a list created in R?

Question 22 of 40
★ FPSC ★ PPSC

What does the R function median() compute?

Question 23 of 40
★ FPSC ★ PPSC

How do you install a package in R from the CRAN repository using the install.packages() function?

Question 24 of 40
★ FPSC ★ PPSC

In R, how do you access the help documentation for a specific function, e.g., mean()?

Question 25 of 40
★ FPSC ★ PPSC

What does the lengths() function do in R?

Question 26 of 40
★ FPSC ★ PPSC

How is a character string defined in R?

Question 27 of 40
★ FPSC ★ PPSC

What does the R function table() do?

Question 28 of 40
★ FPSC ★ PPSC

How is the data frame column Age selected in R?

Question 29 of 40
★ FPSC ★ PPSC

What is the purpose of the search() function in R?

Question 30 of 40
★ FPSC ★ PPSC

In R, how is the mean of a numeric vector calculated using the mean() function?

Question 31 of 40
★ FPSC ★ PPSC

Which of the following is "Recommended" package in R?

Question 32 of 40
★ FPSC ★ PPSC

What is the class defined by the following R code? y<-c(2,”t”)

Question 33 of 40
★ FPSC ★ PPSC

What will be the output of the following R code? x <- c(3, 7, NA, 4, 7) y <- c(5, NA, 1, 2, 2) x + y

Question 34 of 40
★ FPSC ★ PPSC

R is published under the . . . . . . . . General Public License version.

Question 35 of 40
★ FPSC ★ PPSC

In 2004, . . . . . . . . purchased the S language from Lucent for $2 million.

Question 36 of 40
★ FPSC ★ PPSC

What is the mode of 'a' in the following R code? a <- c(1,” a”, FALSE)

Question 37 of 40
★ FPSC ★ PPSC

. . . . . . . . provides a point-and-click interface to many basic statistic problems.

Question 38 of 40
★ FPSC ★ PPSC

What will be the output of the following R function? paste("Everybody", "is", “a” , "warrior")

Question 39 of 40
★ FPSC ★ PPSC

How to install for a package and all of the other packages on which for depends?

Question 40 of 40
★ FPSC ★ PPSC

. . . . . . . . function is used to watch for all available packages in library.

✓ 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 →