This set of R Programming Language Multiple Choice Questions & Answers (MCQs) focuses on “Functions – 3”.
1. R Commander is used to ___________ in R.
a) Export data
b) Import data
c) Use data
d) Work on data
View Answer
Explanation: R Commander is used to import data in R language. To start the R commander GUI, the user should type in the command Rcmdr into the console. There are 3 different types in which data can be imported in R language.
2. Two vectors M and N are defined as M <- c(3, 2, 4) and N <- c(1, 2). What will be the output of vector Z that is defined as Z <- M*N.
a) Z <- (3, 2, 4)
b) Z <- (3, 6, 4)
c) Z <- (3, 4, 5)
d) Z <- (3, 4, 4)
View Answer
Explanation: In R language when the vectors have different lengths, the multiplication begins with the smaller vector and continues till all the elements in the larger vector have been multiplied.
3. How missing values and impossible values are represented in R language?
a) NA
b) NAN
c) NA & NAN
d) Not Exist
View Answer
Explanation: NaN (Not a Number) is used to represent impossible values whereas NA (Not Available) is referred to represent missing values. It is good to find the missing values and then take the necessary steps to handle them.
4. CRAN package ecosystem has more than ______ packages.
a) 5000
b) 4000
c) 6000
d) 8000
View Answer
Explanation: R language has several packages for solving a particular problem. CRAN package ecosystem has more than 6000 packages.
5. Which function in R language is used to find out whether the means of 2 groups are equal to each other or not?
a) f.tests ()
b) l.tests ()
c) t.tests ()
d) not exist
View Answer
Explanation: t.tests () function in R language is used to find out whether the means of 2 groups are equal to each other. It is not used most commonly in R. It is used in some specific conditions.
6. __________ is the best way for communicating the results of data analysis using the R language.
a) Single document
b) Files
c) Structures
d) Loadings
View Answer
Explanation: The best possible way to do this is to combine the data, code and analysis results for a single document by knitr for reproducible research. This helps others to verify the findings, then engage in discussions.
7. How many types of data structures does R language have?
a) 2
b) 3
c) 5
d) 8
View Answer
Explanation: R language consists of Homogeneous and Heterogeneous data structures. Homogeneous data structures have the same type of objects – Vector, Matrix and Array. Heterogeneous data structures have a different type of objects – Data frames and lists.
8. __________ is the easiest method for reshaping the data before analysis.
a) Transpose()
b) Structure()
c) Package
d) Function
View Answer
Explanation: Transpose t () is the easiest method for reshaping the data before analysis. The transpose (reversing rows and columns) is always the simplest method of reshaping a dataset. Use the t() function to transpose a matrix or a data frame.
9. ___________ function is used to apply an expression for a given dataset.
a) This()
b) With()
c) Unwith()
d) That()
View Answer
Explanation: With a () function is used to apply an expression for a given dataset. R language has a large number of in-built functions and the user can create their own functions. In R, a function is an object to the R interpreter is able to pass control to the function.
10. __________ package is used to speed up data frame management code.
a) Data.table
b) Dplyr
c) Table
d) Data.dplyr
View Answer
Explanation: dplyr is a powerful R-package to transform and summarize tabular data with rows and columns. dplyr package is used to speed up data frame management code. dplyr is a package for data manipulation, written and maintained regularly by Hadley Wickham.
Sanfoundry Global Education & Learning Series – R Programming Language.
Here’s the list of Best Books in R Programming Language .
- Check Information Technology Books
- Check R Programming Books
- Practice Programming MCQs
- Apply for Programming Internship