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

2/7

Page

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

What is the purpose of the length() function in R?

Select an option to see the answer and solution.

In R, how do you create a sequence of even numbers from 2 to 10?

Select an option to see the answer and solution.

What does the sort() function do in R?

Select an option to see the answer and solution.

How do you calculate the mean of a numeric vector in R?

Select an option to see the answer and solution.

In R, how is the minimum value of a numeric vector calculated using the min() function?

Select an option to see the answer and solution.

What does the rev() function do in R?

Select an option to see the answer and solution.

How do you create a vector of logical values in R?

Select an option to see the answer and solution.

In R, what does the abs() function do?

Select an option to see the answer and solution.

What is the purpose of the unique() function in R?

Select an option to see the answer and solution.

How do you create a vector of characters in R?

Select an option to see the answer and solution.

Decimal values are referred as . . . . . . . . data types in R.

Select an option to see the answer and solution.

The . . . . . . . . function can be used to create vectors of objects by concatenating things together.

Select an option to see the answer and solution.

An ordered factor is used to represent an . . . . . . . .

Select an option to see the answer and solution.

What will be the output of the following R code?
x <- c("a", "b", "c")
> as.numeric(x)

Select an option to see the answer and solution.

What will be the output of the following R code?
> m <- 1:10
> m

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

Lists can be coerced with which function?

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

What will be the output of the following R code?
> x <- factor(c("yes", "yes", "no", "yes", "no"))
> table(x)

Select an option to see the answer and solution.