250+ TOP MCQs on Packages and Answers

R Programming Language Multiple Choice Questions on “Packages ”.

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

Answer: c
Clarification: 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.

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

Answer: c
Clarification: 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()

Answer: b
Clarification: 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

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

Answer: c
Clarification: 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.

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

Answer: c
Clarification: 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

Answer: a
Clarification: 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.

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

Answer: b
Clarification: 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

Answer: c
Clarification: 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

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

Leave a Reply

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