Introduction To R Programming — Part 2 MCQs with Explanations
Practice high-yield Programming & Software Development MCQs on Introduction To R Programming — 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
. . . . . . . . text editor provides more general support mechanisms via ESS for working interactively with R.
Correct Answer: Option B — Emacs
Detailed Academic Explanation:
Emacs is the correct answer to “. . . . . . . . text editor provides more general support mechanisms via ESS for working interactively with R.”. This question is standard in competitive examination syllabi for Introduction To R Programming.
💡Key Conceptual Anchor:Introduction To R Programming
Question 2 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following is a base package for R language?
Correct Answer: Option C — tools
Detailed Academic Explanation:
tools is the correct answer to “Which of the following is a base package for R language”. This question is standard in competitive examination syllabi for Introduction To R Programming.
💡Key Conceptual Anchor:Introduction To R Programming
Question 3 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the function to set column names for a matrix?
Correct Answer: Option B — colnames()
Detailed Academic Explanation:
colnames() is the correct answer to “What is the function to set column names for a matrix”. This question is standard in competitive examination syllabi for Introduction To R Programming.
💡Key Conceptual Anchor:Introduction To R Programming
Question 4 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following R code? x<- c (“a”,” b”) as.numeric(x)
Correct Answer: Option C — [1] NA NA (Warning message: NAs introduced by coercion)
Detailed Academic Explanation:
[1] NA NA (Warning message: NAs introduced by coercion) is the correct answer to “What will be the output of the following R code? x<- c (“a”,” b”) as.numeric(x)”. This question is standard in competitive examination syllabi for Introduction To R Programming.
💡Key Conceptual Anchor:Introduction To R Programming
Question 5 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Files containing R scripts ends with extension . . . . . . . .
Correct Answer: Option B — .R
Detailed Academic Explanation:
.R is the correct answer to “Files containing R scripts ends with extension . . . . . . . .”. This question is standard in competitive examination syllabi for Introduction To R Programming.
💡Key Conceptual Anchor:Introduction To R Programming
Question 6 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
R has many functions regarding . . . . . . . .
Correct Answer: Option D — Statistics, Probability, Distributions
Detailed Academic Explanation:
Statistics, Probability, Distributions is the correct answer to “R has many functions regarding . . . . . . . .”. This question is standard in competitive examination syllabi for Introduction To R Programming.
💡Key Conceptual Anchor:Introduction To R Programming
Question 7 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
In R language, a vector is defined that it can only contain objects of the . . . . . . . .
Correct Answer: Option A — Same class
Detailed Academic Explanation:
Same class is the correct answer to “In R language, a vector is defined that it can only contain objects of the . . . . . . . .”. This question is standard in competitive examination syllabi for Introduction To R Programming.
💡Key Conceptual Anchor:Introduction To R Programming
Question 8 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following can be used to display the names of (most of) the objects which are currently stored within R?
Correct Answer: Option B — objects()
Detailed Academic Explanation:
objects() is the correct answer to “Which of the following can be used to display the names of (most of) the objects which are currently stored within R”. This question is standard in competitive examination syllabi for Introduction To R Programming.
💡Key Conceptual Anchor:Introduction To R Programming
Question 9 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which language is best for the statistical environment?
Correct Answer: Option B — R
Detailed Academic Explanation:
R is the correct answer to “Which language is best for the statistical environment”. This question is standard in competitive examination syllabi for Introduction To R Programming.
💡Key Conceptual Anchor:Introduction To R Programming
Question 10 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following R function? Sys.Date()
Correct Answer: Option B — Present date
Detailed Academic Explanation:
Present date is the correct answer to “What will be the output of the following R function? Sys.Date()”. This question is standard in competitive examination syllabi for Introduction To R Programming.
💡Key Conceptual Anchor:Introduction To R Programming
Question 11 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the class defined in the following R code? y<-c(FALSE,2)
Correct Answer: Option B — Numeric
Detailed Academic Explanation:
Numeric is the correct answer to “What is the class defined in the following R code? y<-c(FALSE,2)”. This question is standard in competitive examination syllabi for Introduction To R Programming.
💡Key Conceptual Anchor:Introduction To R Programming
Question 12 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following statement is alternative to . . . . . . . . ?solve
Correct Answer: Option A — help(solve)
Detailed Academic Explanation:
help(solve) is the correct answer to “Which of the following statement is alternative to . . . . . . . . ?solve”. This question is standard in competitive examination syllabi for Introduction To R Programming.
💡Key Conceptual Anchor:Introduction To R Programming
Question 13 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
How can we define 'infinity' in R language?
Correct Answer: Option A — Inf
Detailed Academic Explanation:
Inf is the correct answer to “How can we define 'infinity' in R language”. This question is standard in competitive examination syllabi for Introduction To R Programming.
💡Key Conceptual Anchor:Introduction To R Programming
Question 14 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
The copyright for the primary source code for R is held by the . . . . . . . . Foundation.
Correct Answer: Option D — R
Detailed Academic Explanation:
R is the correct answer to “The copyright for the primary source code for R is held by the . . . . . . . . Foundation.”. This question is standard in competitive examination syllabi for Introduction To R Programming.
💡Key Conceptual Anchor:Introduction To R Programming
Question 15 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the output of getOption("defaultPackages") in R studio?
Correct Answer: Option B — Shows default packages in R
Detailed Academic Explanation:
Shows default packages in R is the correct answer to “What is the output of getOption("defaultPackages") in R studio”. This question is standard in competitive examination syllabi for Introduction To R Programming.
💡Key Conceptual Anchor:Introduction To R Programming
Question 16 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
R functionality is divided into a number of . . . . . . . .
Correct Answer: Option A — Packages
Detailed Academic Explanation:
Packages is the correct answer to “R functionality is divided into a number of . . . . . . . .”. This question is standard in competitive examination syllabi for Introduction To R Programming.
💡Key Conceptual Anchor:Introduction To R Programming
Question 17 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
In order to use the R-related functionality in Dundas BI, you must have access to an existing . . . . . . . .
Correct Answer: Option D — R server
Detailed Academic Explanation:
R server is the correct answer to “In order to use the R-related functionality in Dundas BI, you must have access to an existing . . . . . . . .”. This question is standard in competitive examination syllabi for Introduction To R Programming.
💡Key Conceptual Anchor:Introduction To R Programming
Question 18 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Command lines entered at the console are limited to about . . . . . . . . bytes.
Correct Answer: Option B — 4095
Detailed Academic Explanation:
4095 is the correct answer to “Command lines entered at the console are limited to about . . . . . . . . bytes.”. This question is standard in competitive examination syllabi for Introduction To R Programming.
💡Key Conceptual Anchor:Introduction To R Programming
Question 19 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
The R-help and . . . . . . . . mailing lists have been highly active for over a decade now.
Correct Answer: Option B — R-devel
Detailed Academic Explanation:
R-devel is the correct answer to “The R-help and . . . . . . . . mailing lists have been highly active for over a decade now.”. This question is standard in competitive examination syllabi for Introduction To R Programming.
💡Key Conceptual Anchor:Introduction To R Programming
Question 20 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Is It possible to inspect the source code of R?
Correct Answer: Option A — Yes
Detailed Academic Explanation:
Yes is the correct answer to “Is It possible to inspect the source code of R”. This question is standard in competitive examination syllabi for Introduction To R Programming.
💡Key Conceptual Anchor:Introduction To R Programming
Question 21 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following packages does not contain in "base" R system?
Correct Answer: Option B — mesh, compiler
Detailed Academic Explanation:
mesh, compiler is the correct answer to “Which of the following packages does not contain in "base" R system”. This question is standard in competitive examination syllabi for Introduction To R Programming.
💡Key Conceptual Anchor:Introduction To R Programming
Question 22 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
In the expression x <- 4 in R, what is the class of 'x' as determined by the `class()' function?
Correct Answer: Option B — Numeric
Detailed Academic Explanation:
Numeric is the correct answer to “In the expression x <- 4 in R, what is the class of 'x' as determined by the `class()' function”. This question is standard in competitive examination syllabi for Introduction To R Programming.
💡Key Conceptual Anchor:Introduction To R Programming
Question 23 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Functionality of R is divided into a number of . . . . . . . .
Correct Answer: Option A — Functions
Detailed Academic Explanation:
Functions is the correct answer to “Functionality of R is divided into a number of . . . . . . . .”. This question is standard in competitive examination syllabi for Introduction To R Programming.
💡Key Conceptual Anchor:Introduction To R Programming
Question 24 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following R code? x <- (“a”, “b”) as.logical(x)
Correct Answer: Option D — Error
Detailed Academic Explanation:
Error is the correct answer to “What will be the output of the following R code? x <- (“a”, “b”) as.logical(x)”. This question is standard in competitive examination syllabi for Introduction To R Programming.
💡Key Conceptual Anchor:Introduction To R Programming
Question 25 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the mode of b in the following R code? b <- c(TRUE, TRUE, 1)
Correct Answer: Option A — Numeric
Detailed Academic Explanation:
Numeric is the correct answer to “What is the mode of b in the following R code? b <- c(TRUE, TRUE, 1)”. This question is standard in competitive examination syllabi for Introduction To R Programming.
💡Key Conceptual Anchor:Introduction To R Programming
Question 26 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following command is used to print an object "x" in R?
Correct Answer: Option B — print(x)
Detailed Academic Explanation:
print(x) is the correct answer to “Which of the following command is used to print an object "x" in R”. This question is standard in competitive examination syllabi for Introduction To R Programming.
💡Key Conceptual Anchor:Introduction To R Programming
Question 27 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following R code? a <- (“a” , “b”) mode(a)
Correct Answer: Option A — Character
Detailed Academic Explanation:
Character is the correct answer to “What will be the output of the following R code? a <- (“a” , “b”) mode(a)”. This question is standard in competitive examination syllabi for Introduction To R Programming.
💡Key Conceptual Anchor:Introduction To R Programming
Question 28 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following operator is used to create integer sequences?
Correct Answer: Option A — :
Detailed Academic Explanation:
: is the correct answer to “Which of the following operator is used to create integer sequences”. This question is standard in competitive examination syllabi for Introduction To R Programming.
💡Key Conceptual Anchor:Introduction To R Programming
Question 29 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
The primary source code copyright for R is held by the . . . . . . . .
Correct Answer: Option A — R Foundation
Detailed Academic Explanation:
R Foundation is the correct answer to “The primary source code copyright for R is held by the . . . . . . . .”. This question is standard in competitive examination syllabi for Introduction To R Programming.
💡Key Conceptual Anchor:Introduction To R Programming
Question 30 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following is default prompt for UNIX environment?
Correct Answer: Option A — >
Detailed Academic Explanation:
> is the correct answer to “Which of the following is default prompt for UNIX environment”. This question is standard in competitive examination syllabi for Introduction To R Programming.
💡Key Conceptual Anchor:Introduction To R Programming
Question 31 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
The open source . . . . . . . . software is available for Unix, Linux, and Windows platforms.
Correct Answer: Option A — Rserve
Detailed Academic Explanation:
Rserve is the correct answer to “The open source . . . . . . . . software is available for Unix, Linux, and Windows platforms.”. This question is standard in competitive examination syllabi for Introduction To R Programming.
💡Key Conceptual Anchor:Introduction To R Programming
Question 32 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is output of getOption("defaultPackages") in R studio?
Correct Answer: Option B — Shows default packages in R
Detailed Academic Explanation:
Shows default packages in R is the correct answer to “What is output of getOption("defaultPackages") in R studio”. This question is standard in competitive examination syllabi for Introduction To R Programming.
💡Key Conceptual Anchor:Introduction To R Programming
Question 33 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
. . . . . . . . will divert all subsequent output from the console to an external file.
Correct Answer: Option A — sink
Detailed Academic Explanation:
sink is the correct answer to “. . . . . . . . will divert all subsequent output from the console to an external file.”. This question is standard in competitive examination syllabi for Introduction To R Programming.
💡Key Conceptual Anchor:Introduction To R Programming
Question 34 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following is used for Statistical analysis in R language?
Correct Answer: Option A — RStudio
Detailed Academic Explanation:
RStudio is the correct answer to “Which of the following is used for Statistical analysis in R language”. This question is standard in competitive examination syllabi for Introduction To R Programming.
💡Key Conceptual Anchor:Introduction To R Programming
Question 35 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following is a "Recommended" package in R?
Correct Answer: Option D — Spatial
Detailed Academic Explanation:
Spatial is the correct answer to “Which of the following is a "Recommended" package in R”. This question is standard in competitive examination syllabi for Introduction To R Programming.
💡Key Conceptual Anchor:Introduction To R Programming
Question 36 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
The entities that R creates and manipulates are known as . . . . . . . .
Correct Answer: Option A — objects
Detailed Academic Explanation:
objects is the correct answer to “The entities that R creates and manipulates are known as . . . . . . . .”. This question is standard in competitive examination syllabi for Introduction To R Programming.
💡Key Conceptual Anchor:Introduction To R Programming
Question 37 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following describes R language?
Correct Answer: Option A — Free
Detailed Academic Explanation:
Free is the correct answer to “Which of the following describes R language”. This question is standard in competitive examination syllabi for Introduction To R Programming.
💡Key Conceptual Anchor:Introduction To R Programming
Question 38 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
In 1991, R was created by Ross Ihaka and Robert Gentleman in the Department of Statistics at the University of . . . . . . . .
Correct Answer: Option D — Auckland
Detailed Academic Explanation:
Auckland is the correct answer to “In 1991, R was created by Ross Ihaka and Robert Gentleman in the Department of Statistics at the University of . . . . . . . .”. This question is standard in competitive examination syllabi for Introduction To R Programming.
💡Key Conceptual Anchor:Introduction To R Programming
Question 39 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following R function? d <- date() d
Correct Answer: Option C — Prints exact present time and date
Detailed Academic Explanation:
Prints exact present time and date is the correct answer to “What will be the output of the following R function? d <- date() d”. This question is standard in competitive examination syllabi for Introduction To R Programming.
💡Key Conceptual Anchor:Introduction To R Programming
Question 40 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following R code? options(digits = 16) 20/6
Correct Answer: Option D — 3.3333333333333333
Detailed Academic Explanation:
3.3333333333333333 is the correct answer to “What will be the output of the following R code? options(digits = 16) 20/6”. This question is standard in competitive examination syllabi for Introduction To R Programming.
💡Key Conceptual Anchor:Introduction To R Programming
✓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.