250+ TOP MCQs on R Programming Basics and Answers

R Programming Language Multiple Choice Questions on “Basics”.

1. Is It possible to inspect the source code of R?
a) Yes
b) No
c) Can’t say
d) Some times

Answer: a
Clarification: Anybody is free to download and install these packages and even inspect the source code. The instructions for obtaining R largely depend on the user’s hardware and operating system.

2. How to install for a package and all of the other packages on which for depends?
a) install.packages (for, depends = TRUE)
b) R.install.packages (“for”, depends = TRUE)
c) install.packages (“for”, depends = TRUE)
d) install (“for”, depends = FALSE)

Answer: c
Clarification: To install a package named for, open up R and type install.packages(“for”). To install foo and additionally install all of the other packages on which for depends, instead type install.packages (“for”, depends = TRUE).

3. __________ function is used to watch for all available packages in library.
a) lib()
b) fun.lib()
c) libr()
d) library()

Answer: d
Clarification: Type library() at the command prompt to see a list of all available packages in the library. For total information about the installation of R and add-on packages, see the R Installation and Administration manual.

4. The longer programs are called ____________
a) Files
b) Structures
c) Scripts
d) Data

Answer: c
Clarification: The longer programs called scripts, there is too much code to write all at once at the command prompt. Furthermore, for longer scripts, it is convenient to be able to only modify a certain piece of the script and run it again in R.

5. Scripts will run on ___________________
a) Script Editors
b) Console
c) Terminal
d) GCC Compiler

Answer: a
Clarification: script editors are designed to aid the communication and code writing process. They have all sorts of features including R syntax highlighting, automatic code completion, delimiter matching, and dynamic help on the R functions.

6. Which of the following is a “Recommended” package in R?
a) Util
b) Lang
c) Stats
d) Spatial

Answer: d
Clarification: “Recommended” packages also include boot, class, cluster, codetools, foreign, KernSmooth, lattice, mgcv, nlme, rpart, survival, MASS, nnet, Matrix. There are about ten thousand packages in R now.

7. Full Form of GUI is ___________________
a) Guided User Interface
b) Graphical User Interface
c) Guided Used Interface
d) Graphical User Interval

Answer: b
Clarification: GUI elements are usually accessed through a device. All programs running a GUI use a consistent set of graphical elements so that once the user learns a particular interface.

8. ____________ provides a point-and-click interface to many basic statistic problems.
a) Commander
b) GUI
c) Console
d) Terminal

Answer: a
Clarification: R Commander provides a point-and-click interface to statistical problems. It is called the “Commander” because every time one makes a selection, the code corresponding to the task is listed in the output window.

9. What will be the output of the following R code?

options(digits = 16)
20/6

a) 3.33
b) 3.333
c) 3.3333333
d) 3.3333333333333333

Answer: d
Clarification: We know that 20/6 is a repeating decimal, We can change the number of digits displayed with options. This will make the number after the decimal point to extend for the required amount.

10. In which IDE we can interact with R?
a) R studio
b) Console
c) GCC
d) Power shell

Answer: a
Clarification: An IDE tailored to the needs of interactive data analysis and statistical programming called R studio. In R studio we can directly interact with R through the inbuilt functions and packages. We can also download new packages.

11. Which programming language is more based on the results?
a) R
b) C
c) C++
d) Java

Answer: a
Clarification: Compared to other programming languages, the R community tends to be more focussed on results instead of processes. Knowledge of software engineering best practice.

12. Why learning R becomes tough?
a) Special files
b) Functions
c) Packages
d) Special Cases

Answer: d
Clarification: You are confronted with over 20 years of evolution every time you use R. Learning R can be hard because there are many special cases in R to remember. R is the best user of memory.

13. R is mostly used in ______________
a) Problem solving
b) Statistics
c) Probability
d) All of the mentioned

Answer: d
Clarification: Statistics for relatively advanced users. R has thousands of packages, designed, maintained, and widely used by statisticians. We can code ourselves if a command is not present.

14. Why is it needed for R studio to update regularly?
a) Bugs
b) More Functions
c) Methods
d) For more packages

Answer: a
Clarification: RStudio is very popular with a nice interface and well thought out, especially for more advanced usage. It can be a bit buggy, so make sure you update it regularly. Available on all platforms.

15. What is the meaning of “<-“?
a) Functions
b) Loops
c) Addition
d) Assignment

Answer: d
Clarification: The expression a <- 16 creates a variable called a and gives it the value 16 called assignment. The variable on the left is assigned to the value on the right. The left side should have only a single one.

16. In the expression x <- 4 in R, what is the class of ‘x’ as determined by the `class()’ function?
a) Character
b) Numeric
c) Integer
d) Word

Answer: c
Clarification: In R, there is an extension of the numeric or character vectors. They are not a separate type of object but simply an atomic vector with dimensions.

Leave a Reply

Your email address will not be published. Required fields are marked *