R Interview Questions – Set 01

Explain anova() function.

The anova() function is used for comparing the nested models.

Explain aggregate() function.

The aggregate() function is used to aggregate data in R. There are two methods which are collapsing data by using one or more BY variable and other is an aggregate() function in which By variable should be in the list.

Differentiate between vector, List, Matrix, and Data frame.

A vector is a series of data elements of the same basic type. The members in the vector are known as a component.

The R object that contains elements of different types such as numbers, strings, vectors, or another list inside it, is known as List.

A two-dimensional data structure used to bind the vectors from the same length, known as the matrix. The matrix contains the same types of elements.

A Data frame is a generic form of a matrix. It is a combination of lists and matrices. In the Data frame, different data columns contain different data types.

Define MATLAB and party packages.

This package includes wrapper functions and variable which are used for replicating Matlab function calls.

Why do we use apply() function in R?

This is used to apply the same function to each of the elements in an Array. For example, finding the mean of the rows in every row.

Give any five features of R.

  1. Simple and effective programming language.
  2. It is a data analysis software.
  3. It gives effective storage facility and data handling.
  4. It gives high extensible graphical techniques.
  5. It is an interpreted language.

Explain Pie chart in R.

R programming language has several libraries for creating charts and graphs. A pie-chart is a representation of values in the form of slices of a circle with different colors.

Explain the use of the forecast package.

The forecast package gives the functions which are used to automatic selection of exponential and ARIMA models.

Give the name of the Hadoop integration methods.

  • R Hadoop
  • Hadoop Streaming
  • RHIPE
  • ORCH

Explain cv.lm() and stepAIC() function.

The cv.lm() function is defined under the DAAG package used for k-fold validation while the stepAIC() function is defined under the MASS package that performs stepwise model selection under exactAIC.