# R Programming Online Quiz Questions and Answers

**1. R Quiz Questions**

**R** Technology is an open source programming language. One of the most important things of R is that it produces the best publication quality post. This is because R is available as Free Software under the terms of the Free Software Foundation’s GNU. R is a very important topic because R is trending too much nowadays. If you are not familiar with R you can go through our **R tutorials**. After reading this tutorial, to boost your mind and to check your knowledge you can refer this R Programming online quiz questions and answers. This quiz is totally based on R.

This R programming quiz contained objective type questions related to R as well as we have cover detailed answers also for the better understanding of each and every question.

#### Q.1 Which of the following is a base package for R language?

#### Q.2 R comes with a ________ to help you optimize your code and improve its performance.

#### Q.3 debug() flags a function for ______ mode in R mode.

#### Q.4 ______ suspends the execution of a function wherever it is called and puts the function in debug mode

#### Q.5 A matrix is ___dimensionsinal rectangular data set?

#### Q.6 The _____ function takes a vector or other objects and splits it into groups determined by a factor or list of factors.

#### Q.7 lapply function takes___ arguments in R language

#### Q.8 ____is used to apply a function over subsets of a vector

#### Q.9 _______applies a function over the margins of an array

#### Q.10 ____function is same as lapply() in R

#### Q.11 _______ loop over a list and evaluate a function on each element

#### Q.12 __________ is proprietary tool for predictive analytics.

#### Q.13 Data frames can be converted to a matrix by calling data._______

#### Q.14 Which of the following method make a vector of repeated values?

#### Q.15 R objects can have attributes, which are like ________ for the object

#### Q.16 Attributes of an object (if any) can be accessed using the ______ function.

#### Q.17 _________ involves predicting a response with meaningful magnitude, such as quantity sold, stock price, or return on investment.

#### Q.18 ________ provides needed string operators in R

#### Q.19 ______ splits a data frame and results in an array (hence the da). Hopefully, you’re getting the idea here.

#### Q.20 System.time function returns an object of class _______ which contains two useful bits of information.

#### Q.21 Which of the following will start the R program?

#### Q.22 Which of the following is used for Statistical analysis in R language?

#### Q.23 R functionality is divided into a number of ________

#### Q.24 Which of the following is an example of vectorized operation as far as subtraction is concerned?

> x <- 1:4

> y <- 6:9

#### Q.25 What would be the output of the following code?

> x <- 1:4

> y <- 6:9

> z <- x + y

> z

#### Q.26 What would be the output of the following code?

> x <- 1:4

> x > 2

#### Q.27 What would be the value of the following expression?

log(-1)

#### Q.28 What will be the output of the following code?

> g <- function(x) {

+ a <- 3

+ x+a+y

+ ## 'y' is a free variable

+ }

> g(2)

#### Q.29 What will be the output of the following code?

function(p) {

params[!fixed] <- p

mu <- params[1]

sigma <- params[2]

## Calculate the Normal density

a <- -0.5*length(data)*log(2*pi*sigma^2)

b <- -0.5*sum((data-mu)^2) / (sigma^2)

-(a + b)

}

> ls(environment(nLL))

#### Q.30 Which of the following is a principle of analytic graphics?

If you have any doubt about any questions in this R programming online quiz, so please share with us in the comment section given below. Hope we will help you.

Play our next R Programming Quiz Part – 2

Q.5. A matrix is ___dimensional rectangular data set?

plz tell me answer

correct answer is 2. but here it is not accepting as a right answer..

Hi Sai Kumar,

Thanks for asking a Query, on “R Programming Online Quiz”. It was just a Type error the correct answer is “A Matrix is TWO-dimensional rectangular data set.

Hope we solve your query.

Keep Learning and Keep visiting Data-Flair

Q.5. A matrix is ___dimensional rectangular data set?

The Answer is Two in accordance to the given link, but the result is marking as wrong…

Hi Koushik Roy,

Thanks for Commenting on this R Quiz and help other readers. It was just a Type Error, we solved it, Hope you are enjoying this R programming tutorial and you can practice your R programming Knowledge in other R Quiz Part – 2.

Regards,

Data-Flair

________ provides needed string operators in R

Answer of this question???

Hi Sambhaji Jogdand,

Thanks for Asking query on “R Programming Quiz”, the correct answer “stringr”.

Keep Learning and Keep visiting Data-Flair

Tell me the answers

Hello Pratyusha,

You asked for the answers. When you attempt the R programming Quiz, click on the option which you feel is correct. If it shows green color, it means you answered correctly and if it shows red it means you have selected an incorrect answer. The interesting part of this online R quiz is that it gives you the explanation with the link so that you can learn the concepts deeply.

If you are still confused we are happy to help.

so good

Thank you, Nattakit,

So, you have checked your knowledge with R quiz. Now, prepare yourself for your upcoming R interviews –

https://data-flair.training/blogs/r-interview-questions-and-answers/

Share feedback again.

Keep Learning with Data Flair

Cannot find answers. Please let me know how to get the answer key

Hello Arti,

Thanks for interacting with DataFlair. We do not have a separate answer key, but you will find the answer to each question every time you answer it. If you answered correct, it will turn green; otherwise, it will turn red while also highlighting the correct answer in green. Hope, you understood.

ok

What would be the result of following code?

X<-c("X","y","z")as.logical(X)

Can I get a clarification on question 14.

I thought the correct answer is rep()