adplus-dvertising
frame-decoration

Question

What will be the output of the following R code?
> x <- list(1, "a", TRUE, 1 + 4i)
> x

a.

[[1]]
[1] 1

[[2]]
[1] "a"

[[3]]
[1] TRUE

[[4]]
[1] 1+4i

b.

[[1]]
[1] 2

[[2]]
[1] "b"

[[3]]
[1] TRUE

[[4]]
[1] 1+4i

c.

[[1]]
[1] 3

[[2]]
[1] "a"

[[3]]
[1] TRUE

[[4]]
[1] 1+4i

d.

[[1]]
[1] 77

[[2]]
[1] "a"

[[3]]
[1] False

[[4]]
[1] 1+5i

Answer: (a).[[1]]
[1] 1

[[2]]
[1] "a"

[[3]]
[1] TRUE

[[4]]
[1] 1+4i

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What will be the output of the following R code?

Similar Questions

Discover Related MCQs

Q. Point out the correct statement?

Q. The ________ function takes an arbitrary number of arguments and concatenates them one by one into character strings.

Q. The _________ function returns a list of densities (y) corresponding to bin values (x).

Q. Locator function gives output as ___________

Q. Density function gives output as ________

Q. Which function gives the list as output?

Q. Joining two lists can be achieved either using the _________ function.

Q. Which function can be used to determine the names assigned to a list?

Q. The length of a list is ______ to the number of components in that list.

Q. To extract a sublist, we use _________ brackets.

Q. The first component can be accessed using __________ operator.

Q. How can we access the first component of the list?

Q. First component of the list can be accessed by _____________

Q. Lists can be created using the _______ function.

Q. What should we use to access elements with a value greater than five?

Q. Which are indexed by either row or column using a specific name or number?

Q. Accessing elements is achieved through a process called ________

Q. Using the ________ vector, we create a species factor and bind it to the columns of iris.df.

Q. Which dimension corresponds to the explanatory variables collected for each species?

Q. Which of the following is a 3-dimensional dataset?