R Programming Questions and Answers – Basics – 4

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?
a) Yes
b) No
c) Can’t say
d) Some times
View Answer

Answer: a
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)
View Answer

Answer: c
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.
a) lib()
b) fun.lib()
c) libr()
d) library()
View Answer

Answer: d
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.
advertisement
advertisement

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

Answer: c
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
b) Console
c) Terminal
d) GCC Compiler
View Answer

Answer: a
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.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

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

Answer: d
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
View Answer

Answer: b
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.
advertisement

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

Answer: a
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?

advertisement
options(digits = 16)
20/6

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

Answer: d
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
b) Console
c) GCC
d) Power shell
View Answer

Answer: a
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?
a) R
b) C
c) C++
d) Java
View Answer

Answer: a
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
b) Functions
c) Packages
d) Special Cases
View Answer

Answer: d
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
b) Statistics
c) Probability
d) All of the mentioned
View Answer

Answer: d
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?
a) Bugs
b) More Functions
c) Methods
d) For more packages
View Answer

Answer: a
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 “<-“?
a) Functions
b) Loops
c) Addition
d) Assignment
View Answer

Answer: d
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?
a) Character
b) Numeric
c) Integer
d) Word
View Answer

Answer: b
Explanation: In R, when you assign the value 4 to a variable ‘x’, its class is “numeric”. The class() function confirms this by showing that the variable ‘x’ belongs to the “numeric” class.

Sanfoundry Global Education & Learning Series – R Programming Language.

Here’s the list of Best Books in R Programming Language .

To practice all areas of R Programming Language, Here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.