This set of R Programming Language Multiple Choice Questions & Answers (MCQs) focuses on “Basics – 4”.
1. Is It possible to inspect the source code of R?
c) Can’t say
d) Some times
Explanation: 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)
Explanation: 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.
Explanation: 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 ____________
Explanation: 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
d) GCC Compiler
Explanation: 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?
Explanation: “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
Explanation: 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.
Explanation: 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
Explanation: 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
d) Power shell
Explanation: 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?
Explanation: 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
d) Special Cases
Explanation: 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
d) All of the mentioned
Explanation: 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?
b) More Functions
d) For more packages
Explanation: 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 “<-“?
Explanation: 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?
Explanation: 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.
Sanfoundry Global Education & Learning Series – R Programming Language.