adplus-dvertising

Welcome to the Formats,Objects and Operations MCQs Page

Dive deep into the fascinating world of Formats,Objects and Operations with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Formats,Objects and Operations, a crucial aspect of R Programming. In this section, you will encounter a diverse range of MCQs that cover various aspects of Formats,Objects and Operations, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within R Programming.

frame-decoration

Check out the MCQs below to embark on an enriching journey through Formats,Objects and Operations. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of R Programming.

Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Formats,Objects and Operations. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Formats,Objects and Operations MCQs | Page 5 of 10

Q41.
What will be the output of the following R code?
> x <- matrix(1:6, 2, 3)
> x[1, 2]

a.

3

b.

2

c.

1

d.

0

Discuss
Answer: (a).3
Q42.
What will be the output of the following R code?
> x <- matrix(1:6, 2, 3)
> x[1, ]
Discuss
Answer: (a).1 3 5
Q43.
Which of the following R code extracts the second column for the following matrix?
> x <- matrix(1:6, 2, 3)
Discuss
Answer: (c).x[, 2]
Q44.
What will be the output of the following R code?
> x <- matrix(1:6, 2, 3)
> x[1, , drop = FALSE]
Discuss
Answer: (a).[,1] [,2] [,3]
[1,] 1 3 5
Q45.
What will be the output of the following R code?
> x <- list(foo = 1:4, bar = 0.6)
> x
Discuss
Answer: (a).$foo
[1] 1 2 3 4
$bar
[1] 0.6
Q46.
Which of the following extracts first element from the following R list?
> x <- list(foo = 1:4, bar = 0.6)
Discuss
Answer: (a).x[[1]]
Discuss
Answer: (a).You can also use the $ operator to extract elements by name
Q48.
What will be the output of the following R code?
> x <- list(foo = 1:4, bar = 0.6, baz = "hello")
> name <- "foo"
> x$name
Discuss
Answer: (d).NULL
Q49.
What will be the output of the following R code?
> x <- list(foo = 1:4, bar = 0.6, baz = "hello")
> name <- "foo"
> x[[name]]
Discuss
Answer: (a).1 2 3 4
Q50.
What will be the output of the following R code?
> x <- list(a = list(10, 12, 14), b = c(3.14, 2.81))
> x[[c(1, 3)]]
Discuss
Answer: (b).14
Page 5 of 10

Suggested Topics

Are you eager to expand your knowledge beyond R Programming? We've curated a selection of related categories that you might find intriguing.

Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!