R Programming MCQ: R Programming Multiple Choice Questions

R Programming MCQ with answers and explanations for placement tests and job interviews. These solved R Programming MCQ questions are useful for the campus placement for all freshers including Engineering Students, MCA students, Computer and IT Engineers, etc.

Our R Programming MCQ ( R Programming Multiple Choice Questions and Answer )  focuses on all areas of R Language Programming. We will also regularly update the R Programming MCQ and most interesting thing is that questions come in a random sequence. So every time you will feel new questions.

Note: Your score along with correct answers will be visible after answering all of these questions.

So let’s see our R Programming MCQ (Multiple Choice Questions & Answers on “R Programming”).

R Programming MCQ

R Programming MCQ: R Programming Multiple Choice Questions

1 / 42

Which of the following will start the R program?

2 / 42

Review the statements below. Does the use of the dim function change the class of y, and if so what is y's new class?

> y <- 1:9
> dim(y) <- c(3,3)

3 / 42

What do you use to take an object such as a data frame out of the workspace?

4 / 42

If the code is stored in the external file, which of the following function is used to call them to a working directory?

5 / 42

Which is not a property of lists and vectors?

6 / 42

Review line 1 below. What does the statement in line 2 return?

1 mylist <- list(1,2,"C",4,5)
2 unlist(mylist)

7 / 42

ournames is a character vector. What values does the statement below return to Cpeople?

Cpeople <- ournames %in% grep("^C", ournames, value=TRUE)

8 / 42

d.pizza is a data frame. It's column named temperature contains only numbers. If u extract temperature using the [] accessors, its class defaults to numeric. How can you access temperature so that it retains the class of data.frame?

> class( d.pizza[ , "temperature" ] )
> "numeric"

9 / 42

Given DFMerged <- merge(DF1, DF2) and the image below, how manu rows are in DFMerged?

DF1(data frame 1): DF2(data frame 2):
VarA VarB VarA VarD
1 1 2 1 18 21
2 4 5 2 19 22
3 7 8 3 20 23

10 / 42

_____ text editor provides more general support mechanisms via ESS for working interactively with R.

11 / 42

Which choice does R regard as an acceptable name for a variable?

12 / 42

What is the output of getOption(“defaultPackages”) in R studio?

13 / 42

Point out the wrong statement?

14 / 42

What statement shows the objects on your workspace?

15 / 42

A single element of a character vector is referred as ________

16 / 42

You accidentally display a large data frame on the R console, losing all the statements you entered during the current session. What is the best way to get the prior 25 statements back?

17 / 42

What is the function to set row names for a data frame?

18 / 42

The most convenient way to use R is at a graphics workstation running a ________ system.

19 / 42

What is the value of names(v[4])?

v <- 1:3
names(v) <- c("a", "b", "c")
v[4] <- 4

20 / 42

Elementary commands in R consist of either _______ or assignments.

21 / 42

R files has an extension ______

22 / 42

How many atomic vector types does R have?

23 / 42

What is the value of y in this code?

x <- NA
y <- x/1

24 / 42

How to name rows and columns in DataFrames and Matrices F in R?

25 / 42

What is the principal difference between an array and a matrix?

26 / 42

If a command is not complete at the end of a line, R will give a different prompt, by default it is ____________

27 / 42

What function joins two or more column vectors to form a data frame?

28 / 42

Advanced programmers can write ______ code to manipulate R objects.

29 / 42

Two variable in the mydata data frame are named Var1 and Var2. How do you tell a bivariate function, such as cor.test, which two variables you want to analyze?

30 / 42

What does c contain?

a <- c(3,3,6.5,8)
b <- c(7,2,5.5,10)
c <- a < b

31 / 42

Which function displays the first five rows of the data frame named pizza?

32 / 42

Functionality of R is divided into a number of __________

33 / 42

How does a matrix differ from a data frame?

34 / 42

Which of the following statements doesn't yield the code output below. Review the following code. What is the result of line 3?

x <- c(1, 2, 3, 4)
Output: [1] 2 3 4

35 / 42

Which of the following statement is alternative to _________?

solve

36 / 42

Which of the following is default prompt for UNIX environment?

37 / 42

unclass(as.Date("1971-01-01"))

38 / 42

A data frame named d.pizza is part of the DescTools package. A statement is missing from the following R code and an error is therefore likely to occur. Which statement is missing?

library(DescTools)
deliver <- aggregate(count,by=list(area,driver), FUN=mean)
print(deliver)

39 / 42

The variable height is a numeric vector in the code below. Which statement returns the value 35?

40 / 42

How does a vector differ from a list?

41 / 42

Review the following code. What is the result of line 3?

xvect<-c(1,2,3)
xvect[2] <- "2"
xvect

42 / 42

What is mydf$y in this code?

mydf <- data.frame(x=1:3, y=c("a","b","c"), stringAsFactors=FALSE)

 

Recommended Articles for you: