R Programming MCQ Questions And Answers - Packages
This section focuses on "Packages" in R Programming. These Multiple Choice Questions (MCQ) should be practiced to improve the R Programming skills required for various interviews (campus interviews, walk-in interviews, company interviews), placements, entrance exams and other competitive examinations.
1. Which of the following syntax is used to install forecast package?
A. install.pack("forecast")
B. install.packages("cast")
C. install.packages("forecast")
D. install.pack("forecastcast")
View Answer
Ans : C
Explanation: forecast is used for time series analysis
2. Which splits a data frame and returns a data frame?
A. apply
B. ddply
C. stats
D. plyr
View Answer
Ans : B
Explanation: ddply splits a data frame and returns a data frame.
3. Which of the following is an R package for the exploratory analysis of genetic and genomic data?
A. adeg
B. adegenet
C. anc
D. abd
View Answer
Ans : B
Explanation: This package contains Classes and functions for genetic data analysis within the multivariate framework.
4. Which of the following contains functions for processing uniaxial minute-to-minute accelerometer data?
A. accelerometry
B. abc
C. abd
D. anc
View Answer
Ans : A
Explanation: This package contains a collection of functions that perform operations on time-series accelerometer data, such as identify non-wear time, flag minutes that are part of an activity about, and find the maximum 10-minute average count value.
5. ______ Uses Grieg-Smith method on 2 dimensional spatial data.
A. G.A.
B. G2db
C. G.S.
D. G1DBN
View Answer
Ans : C
Explanation: The function returns a GriegSmith object which is a matrix with block sizes, sum of squares for each block size as well as mean sums of squares. G1DBN is a package performing Dynamic Bayesian Network Inference.
6. Which of the following package provide namespace management functions not yet present in base R?
A. stringr
B. nbpMatching
C. messagewarning
D. namespace
View Answer
Ans : D
Explanation: The package namespace is one of the most confusing parts of building a package. nbpMatching contains functions for non-bipartite optimal matching.
7. What will be the output of the following R code?
install.packages(c("devtools", "roxygen2"))
A. Develops the tools
B. Installs the given packages
C. Exits R studio
D. Nothing happens
View Answer
Ans : B
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.
8. A bundled package is a package that’s been compressed into a ______ file.
A. Double
B. Single
C. Triple
D. No File
View Answer
Ans : B
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.
9. .library() is not useful when developing a package since you have to install the package first.
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : A
Explanation: 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.
10. DESCRIPTION uses a very simple file format called DCF.
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : A
Explanation: 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.
Discussion