R Programming Language Multiple Choice Questions on “Packages ”.
1. _______ is not useful when developing a package since you have to install the package first.
a) Function
b) Library
c) Interface
d) Class
Answer: b
Clarification: library() is not useful when developing a package since you have to install the package first. A library is a simple directory containing installed packages.
2. Which function is used for seeing currently active libraries?
a) Curlib()
b) Currlib()
c) .libpaths()
d) Pathlibr()
Answer: c
Clarification: A library is simply a directory containing installed packages. Everyone can use the dot libPaths() for seeing which libraries are currently active.
3. Which function is used for loading packages?
a) Library
b) Interface
c) Loader
d) Linker
Answer: a
Clarification: library() function is used to load a package. library() is not useful when we are developing a package since you have to install the package first. A library is a simple directory containing installed packages.
4. The job of the __________ file is to store important metadata about your package.
a) Description
b) Interface
c) Thinker
d) Loader
Answer: a
Clarification: The job of the DESCRIPTION file is to store the metadata about your package. When you first start writing packages, you’ll mostly use these metadata to record what packages are needed to run your package.
5. DCF is an abbreviation for__________
a) Debian control function
b) Differentiative common function
c) Debian control format
d) Debian common format
Answer: c
Clarification: DESCRIPTION uses a very simple file format called DCF, the Debian control format. When you first start writing packages, you’ll mostly use these metadata to record what packages are needed to run your package.
6. Which of the following is most important when releasing the package?
a) Versioning
b) Developing
c) Redundancy
d) Functioning
Answer: a
Clarification: Versioning is most important when you release your package. Usually, people don’t have exactly the same versions of packages installed that you do.
7. Which of the following is called a one-line description of the package?
a) Function
b) Title
c) Interface
d) Class
Answer: b
Clarification: Title is a one-line description of the package, and is often also shown in package listing. It should be plain text, capitalised like a title, and NOT end in a period.
8. To release a package to _____ you must pick a standard license.
a) R
b) CRAN
c) CRON
d) Studio
Answer: b
Clarification: To release your package to CRAN, you must pick a standard license. Otherwise, it’s difficult for CRAN to determine whether or not it’s legal to distribute your package.
9. _____ package version is the sequence of atleast two integers separated by either. or -.
a) Java
b) C
c) R
d) Python
Answer: c
Clarification: R package version is the sequence of atleast two integers separated by either. or -. When you first start writing packages, you’ll mostly use these metadata to record what packages are needed to run your package.
10. The ________ number of your package increases with subsequent releases of a package.
a) Function
b) Studio
c) Version
d) Sequence
Answer: c
Clarification: The version number of your package increases with subsequent releases of a package, but it’s more than just an incrementing the counter of the way the number changes with each release can convey information.
11. Which of the following is one of the most important aspects of a good package?
a) Title
b) Description
c) Documentation
d) Libraries
Answer: c
Clarification: Documentation is one of the most important aspects of a good package. Without it, users won’t know how to use your package. Documentation is very much useful for the future.
12. ___________ are the most commonly documented object.
a) Interface
b) Class
c) Functions
d) Libraries
Answer: c
Clarification: Function is very most commonly documented object. The introduction block, most functions have three tags namely @param, @examples and @return.