This set of R Programming Language Multiple Choice Questions & Answers (MCQs) focuses on “Data Types – 7”.
1. Accessing elements is achieved through a process called ________
a) Indexing
b) Outdexing
c) Highlighting
d) Scrapping
View Answer
Explanation: Accessing elements is achieved through a process called indexing. Indexing may be done by a vector of positive integers and negative integers to indicate inclusion.
2. Which are indexed by either row or column using a specific name or number?
a) Datasets
b) Data frames
c) Data
d) Functions
View Answer
Explanation: Data frames can be indexed by either row or column using a specific name (that corresponds to either the row or column) or a number.
3. What should we use to access elements with a value greater than five?
a) Subsetting commands
b) Use functions
c) Packages
d) Interfaces
View Answer
Explanation: To access elements with a value greater than five we can use some subsetting commands and logical operators to produce the desired result.
4. Lists can be created using the _______ function.
a) Matrix.li
b) Matrix.lists
c) Lists.matric
d) List
View Answer
Explanation: Lists can be created using the list function. Like data frames, they can incorporate a mixture of modes into the one list and each component can be of a different length or size.
5. First component of the list can be accessed by _____________
a) Name of the component
b) List name
c) Function
d) Package
View Answer
Explanation: There are a number of ways of accessing the first component of a list. We can either access it through the name of that component (if names are assigned) or by using a number corresponding to the position of the component.
6. How can we access the first component of the list?
a) Number of the position
b) Function
c) Package
d) Tools
View Answer
Explanation: There are a number of ways of accessing the first component of a list. We can either access it through the name of that component (if names are assigned) or by using a number corresponding to the position the component.
7. The first component can be accessed using __________ operator.
a) Intraction
b) Extraction
c) AND
d) OR
View Answer
Explanation: There are a number of ways of accessing the first component of a list. We can either access it through the name of that component (if names are assigned) or by using a number corresponding to the position the component corresponds to. The former approach can be performed using subsetting ([[]]) or alternatively, by the extraction operator ($).
8. To extract a sublist, we use _________ brackets.
a) Flower
b) Square
c) Double
d) Single
View Answer
Explanation: To extract a sublist, we use single brackets. There are a number of ways of accessing the first component of a list.
9. The length of a list is ______ to the number of components in that list.
a) Double
b) Equal
c) Triple
d) One fourth
View Answer
Explanation: The length of a list is equal to the number of components in that list. Lists can be created using the list function. Like data frames, they can incorporate a mixture of modes into the one list and each component can be of a different length or size.
10. Which function can be used to determine the names assigned to a list?
a) Names
b) Name
c) Nam
d) Nem
View Answer
Explanation: To determine the names assigned to a list, the names function can be used. Lists can be created using the list function. Like data frames, they can incorporate a mixture of modes into the one list and each component can be of a different length or size.
11. Joining two lists can be achieved either using the _________ function.
a) Concat
b) Join
c) Reduce
d) Delete
View Answer
Explanation: Joining two lists can be achieved either using the concatenation function or the append function.
12. Which function gives the list as output?
a) Spline
b) Matrix
c) Vector
d) Alphabet
View Answer
Explanation: There are also many functions within R that produce a list as output. Examples of these functions include spline(), density() and locator().Joining two lists can be achieved either using the concatenation function or the append function.
13. Density function gives output as ________
a) Matrix
b) Lists
c) Vector
d) Number
View Answer
Explanation: There are also many functions within R that produce a list as output. Examples of these functions include spline(), density() and locator().
14. Locator function gives output as ___________
a) Matrix
b) Lists
c) Vector
d) Number
View Answer
Explanation: To extract a sublist, we use single brackets. There are a number of ways of accessing the first component of a list. There are also many functions within R that produce a list as output. Examples of these functions include spline(), density() and locator().
15. The _________ function returns a list of densities (y) corresponding to bin values (x).
a) Spline
b) Density
c) Lists
d) Locator
View Answer
Explanation: The spline function returns a list of densities (y) corresponding to bin values (x). These can be passed to the plot routine to produce a line graph of the density.
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
- Apply for Programming Internship
- Practice Programming MCQs