R Programming Questions and Answers – Packages – 4

This set of R Programming Language Multiple Choice Questions & Answers (MCQs) focuses on “Packages – 4”.

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

install.packages(c("devtools", "roxygen2"))

a) Develops the tools
b) Exits R studio
c) Installs the given packages
d) Nothing happens
View Answer

Answer: c
Explanation: Make sure you have the latest version of R and then run the above code to get the packages you’ll need. It installs the given packages. Confirm that you have a recent version of RStudio.
advertisement
advertisement

2. Which of the following is the formal requirement?
a) Package
b) Function
c) Letters
d) Interfaces
View Answer

Answer: c
Explanation: There are three formal requirements: the name can only consist of letters, numbers and periods, i.e., it must start with the letter and it should not end with a period.

3. To start with the new package in RStudio, double-click the pkgname.Rproj file that _______
a) Delete()
b) Create()
c) Run()
d) Exit()
View Answer

Answer: b
Explanation: To get started with your new package in RStudio, double-click the pkgname.Rproj file that create() just made. This will open a new RStudio project for your package. Projects are the way to develop packages.

4. If you have an existing package that doesn’t have an .Rproj file, you can use devtools for the use_rstudio(“_____/to/package”) to add it.
a) Path
b) Package
c) Function
d) Class
View Answer

Answer: a
Explanation: If you have an existing package that doesn’t have an .Rproj file, you can use devtools for the use_rstudio(“path/to/package”) to add it.

5. An .Rproj file is a ____ file.
a) Pdf
b) Jpeg
c) Text
d) Png
View Answer

Answer: c
Explanation: An .Rproj file is a text file. If you don’t use RStudio, you can get many of the benefits by starting a new R session and ensuring that the directory is set to the package directory.
advertisement

6. A bundled package is a package that’s been compressed into a ______ file.
a) Double
b) Triple
c) Single
d) No file
View Answer

Answer: c
Explanation: A bundled package is a package that’s been compressed into a single file. A source package is just a directory with components like R/, DESCRIPTION, and so on.

7. ________ are built in R so that you get HTML.
a) Vignettes
b) Vighnaants
c) Bignats
d) Viddnets
View Answer

Answer: a
Explanation: Vignettes are built for getting the HTML and PDF output instead of Markdown or LaTeX input. A bundled package is a package that’s been compressed into a single file.
advertisement

8. Which of the following package has temporary files?
a) Single
b) Source
c) Bundle
d) Double
View Answer

Answer: b
Explanation: Source package might contain temporary files used to save time during development and the compilation artifacts in a source. These will be never found in a bundle.

9. files listed in the Rbuildignore are not included in the ______
a) single
b) source
c) bundle
d) double
View Answer

Answer: c
Explanation: Files listed in the Rbuildignore were not included in the bundle. .Rbuildignore prevents files from the src package and appearing in the bundled package. It allows you to have some extra directories in your source package that will not be included in the package bundle.

10. .Rbuildignore prevents files in the ___________ package from appearing in the bundled package.
a) single
b) source
c) bundle
d) double
View Answer

Answer: b
Explanation: .Rbuildignore prevents files from the source package and appearing in the bundled package. It allows to have some extra directories in your source package that will not be included in the package bundle.

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.