Vidyalelo
R Programming · all questions

R Programming Basics
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

131

Questions

4/7

Page

Pick an option on a question to see the right answer and solution.

Locator function gives output as . . . . . . . .

Select an option to see the answer and solution.

Numbers in R are generally treated as . . . . . . . . precision real numbers.

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

Which is the basic data structure of R containing the same type of data?

Select an option to see the answer and solution.

What will be the output of the following R code?
> m <- matrix(1:6, nrow = 2, ncol = 3)
> m

Select an option to see the answer and solution.

What will be the output of the following R code?
> x <- data.frame(foo = 1:4, bar = c(T, T, F, F))
> ncol(x)

Select an option to see the answer and solution.

Which of the following is invalid assignment?

Select an option to see the answer and solution.

Which function takes a dim attribute which creates the required number of dimensions?

Select an option to see the answer and solution.

What will be the output of the following R code?
> x <- vector("list", length = 5)
> x

Select an option to see the answer and solution.

A . . . . . . . . is a two-dimensional rectangular data set.

Select an option to see the answer and solution.

Which function is used to combine the elements into a vector?

Select an option to see the answer and solution.

By what function we can create data frames?

Select an option to see the answer and solution.

Which of the following statement would print "0" "1" "2" "3" "4" "5" "6" for the following R code?
> x <- 0:6

Select an option to see the answer and solution.

What will be the output of the following R code?
> x <- 6
> class(x)

Select an option to see the answer and solution.

What will be the Correct R code for the following output?
foo bar
1 1 TRUE
2 2 TRUE
3 3 FALSE
4 4 FALSE

Select an option to see the answer and solution.

. . . . . . . . function returns a vector of the same size as x with the elements arranged in increasing order.

Select an option to see the answer and solution.

R has how many atomic classes of objects?

Select an option to see the answer and solution.

Point out the correct statement?

Select an option to see the answer and solution.

Point out the wrong statement?

Select an option to see the answer and solution.