This set of R Programming Language Multiple Choice Questions & Answers (MCQs) focuses on “Packages – 4”.
1. What is the output of the following code?
a) Develops the tools
b) Exits R studio
c) Installs the given packages
d) Nothing happens
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.
2. Which of the following is the formal requirement?
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 _______
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.
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.
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.
6. A bundled package is a package that’s been compressed into a ______ file.
d) No file
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.
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.
8. Which of the following package has temporary files?
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 ______
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.
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.