Menu

Objective Type Questions & Answers


R - Programming MCQs - Unit-4



1. Which function is used to create a factor in R?

A . level()

B . factor()

C . makefactor()

D . levels()

Answer



2. Factors in R are used to handle _____ data.

A . numeric

B . logical

C . categorical

D . character only

Answer



3. Which function retrieves the levels of a factor?

A . levels()

B . factor()

C . categories()

D . classes()

Answer



4. What function is commonly used to tabulate the counts of factor levels?

A . count()

B . table()

C . freq()

D . tally()

Answer



5. How do you change the order of levels in a factor?

A . factor()

B . levels()

C . relevel()

D . order()

Answer



6. Which of the following is NOT a valid operation on factors?

A . Sorting

B . Summation

C . Tabulation

D . Level changing

Answer



7. In R, a table is mainly used to represent:

A . Logical operations

B . Frequency counts

C . String manipulations

D . Mathematical equations

Answer



8. Which function is used to create a contingency table?

A . ctable()

B . cross()

C . table()

D . xtabs()

Answer



9. How to extract a subtable from a table?

A . subset()

B . subtable()

C . extract()

D . slice()

Answer



10. To find the largest cell value in a table, we use:

A . max()

B . which.max()

C . largest()

D . findmax()

Answer



11. To get the total number of elements in a table, use:

A . sum()

B . total()

C . length()

D . count()

Answer



12. How do you find the cumulative sum of a numeric vector?

A . cumulate()

B . cumsum()

C . sum()

D . accsum()

Answer



13. Which function finds the cumulative product?

A . cumprod()

B . cummult()

C . prod()

D . accumulate()

Answer



14. What function in R finds the minimum value in a vector or table?

A . min()

B . minimum()

C . minval()

D . findmin()

Answer



15. What function finds the maximum value in a set of numbers?

A . max()

B . maximum()

C . maxval()

D . findmax()

Answer



16. Which function in R is used for integration (basic calculus)?

A . integrate()

B . calculus()

C . integral()

D . deriv()

Answer



17. Which function computes the derivative of a function?

A . deriv()

B . diff()

C . derive()

D . integrate()

Answer



18. To calculate probability density for a normal distribution, we use:

A . pnorm()

B . dnorm()

C . qnorm()

D . rnorm()

Answer



19. Which function generates random numbers from a normal distribution?

A . pnorm()

B . dnorm()

C . rnorm()

D . qnorm()

Answer



20. What does pnorm() compute?

A . Random value

B . Density

C . Cumulative probability

D . Quantile

Answer



21. Which function finds the quantile function of a normal distribution?

A . rnorm()

B . dnorm()

C . pnorm()

D . qnorm()

Answer



22. Which function would you use to find cumulative probabilities for binomial distribution?

A . pbinom()

B . dbinom()

C . rbinom()

D . qbinom()

Answer



23. What does dbinom() return?

A . Quantile

B . Cumulative probability

C . Probability mass

D . Random variate

Answer



24. To calculate probabilities for the Poisson distribution, we use:

A . ppois()

B . dpois()

C . rpois()

D . qpois()

Answer



25. rpois() function is used to:

A . Find cumulative probabilities

B . Find probability mass

C . Generate random numbers

D . Find quantiles

Answer



26. qpois() function in R is used for:

A . Probability density

B . Random generation

C . Quantile calculation

D . Summation

Answer



27. The function ppois() returns:

A . Probability density

B . Random number

C . Cumulative probability

D . Quantile

Answer



28. Which function would you use to calculate cumulative sum for a table column?

A . sum()

B . cumsum()

C . cumprod()

D . accumulate()

Answer



29. The function to compute the factorial of a number in R is:

A . factorial()

B . fact()

C . factorials()

D . factorialnum()

Answer



30. What function is used to find differences between successive elements?

A . diff()

B . deriv()

C . delta()

D . differences()

Answer





Relevant Materials :

R - Programming MCQs - Unit-1 - [ R-Programming ]

R - Programming MCQs - Unit-2 - [ R-Programming ]

R - Programming MCQs - Unit-3 - [ R-Programming ]

R - Programming MCQs - Unit-4 - [ R-Programming ]

R - Programming MCQs - Unit-5 - [ R-Programming ]


Similar Materials :

Formal Languages and Automata Theory (FLAT) MCQs - Unit-1 - [ FLAT ]

Formal Languages and Automata Theory (FLAT) MCQs - Unit-2 - [ FLAT ]

Formal Languages and Automata Theory (FLAT) MCQs - Unit-3 - [ FLAT ]

Formal Languages and Automata Theory (FLAT) MCQs - Unit-4 - [ FLAT ]

Formal Languages and Automata Theory (FLAT) MCQs - Unit-5 - [ FLAT ]

Artificial Intelligence (AI) MCQs - Unit-1 - [ Artificial Intelligence ]

Artificial Intelligence (AI) MCQs - Unit-2 - [ Artificial Intelligence ]

Artificial Intelligence (AI) MCQs - Unit-3 - [ Artificial Intelligence ]

Artificial Intelligence (AI) MCQs - Unit-4 - [ Artificial Intelligence ]

Artificial Intelligence (AI) MCQs - Unit-5 - [ Artificial Intelligence ]

PPS MCQs - Unit-1 - [ PPS ]

PPS MCQs - Unit-2 - [ PPS ]

PPS MCQs - Unit-3 - [ PPS ]

PPS MCQs - Unit-4 - [ PPS ]

PPS MCQs - Unit-5 - [ PPS ]

Object Oriented Programming through Java MCQs - Unit-1 - [ OOP_JAVA ]

Object Oriented Programming through Java MCQs - Unit-2 - [ OOP_JAVA ]

Object Oriented Programming through Java MCQs - Unit-3 - [ OOP_JAVA ]

Object Oriented Programming through Java MCQs - Unit-4 - [ OOP_JAVA ]

Object Oriented Programming through Java MCQs - Unit-5 - [ OOP_JAVA ]

Design and Analysis of Algorithms MCQs - Unit-1 - [ DAA ]

Design and Analysis of Algorithms MCQs - Unit-2 - [ DAA ]

Design and Analysis of Algorithms MCQs - Unit-3 - [ DAA ]

Design and Analysis of Algorithms MCQs - Unit-4 - [ DAA ]

Design and Analysis of Algorithms MCQs - Unit-5 - [ DAA ]

Software Engineering MCQs - Unit-1 - [ SE ]

Software Engineering MCQs - Unit-2 - [ SE ]

Software Engineering MCQs - Unit-3 - [ SE ]

Software Engineering MCQs - Unit-4 - [ SE ]

Software Engineering MCQs - Unit-5 - [ SE ]

Data Mining MCQs - Unit-1 - [ DM ]

Data Mining MCQs - Unit-2 - [ DM ]

Data Mining MCQs - Unit-3 - [ DM ]

Data Mining MCQs - Unit-4 - [ DM ]

Data Mining MCQs - Unit-5 - [ DM ]

Computer Organization and Architecture (COA) Objective Question Bank-Unit-1 - [ COA ]

Computer Organization and Architecture (COA) Objective Question Bank-Unit-2 - [ COA ]

Computer Organization and Architecture (COA) Objective Question Bank-Unit-3 - [ COA ]

Computer Organization and Architecture (COA) Objective Question Bank-Unit-4 - [ COA ]

Computer Organization and Architecture (COA) Objective Question Bank-Unit-5 - [ COA ]

Data Structures Objective Type Question Bank-Unit-1 - [ DS ]

Data Structures Objective Type Question Bank-Unit-2 - [ DS ]

Data Structures Objective Type Question Bank-Unit-3 - [ DS ]

Data Structures Objective Type Question Bank-Unit-4 - [ DS ]

Data Structures Objective Type Question Bank-Unit-5 - [ DS ]

Database Management System Objective Type Question Bank-Unit-1 - [ DBMS ]

Database Management System Objective Type Question Bank-Unit-2 - [ DBMS ]

Database Management System Objective Type Question Bank-Unit-3 - [ DBMS ]

Database Management System Objective Type Question Bank-Unit-4 - [ DBMS ]

Database Management System Objective Type Question Bank-Unit-5 - [ DBMS ]