R Interview Questions – Set 03

What is the difference b/w sample() and subset() in R?

The sample() method is used to choose a random sample of size n from a dataset while the subset method is used to choose variables and observations.

Explain initialize() function in R?

This function is used to initialize the private data members while declaring the object.

Give names of visualization packages.

There are the following packages of visualization in R:

  • Plotly
  • ggplot2
  • tidyquant
  • geofacet
  • googleVis
  • Shiny

What is the t-test() in R?

The t-test() function is used to determine that the mean of the two groups are equal or not.

What are the applications of R?

There are various applications available in real-time. These applications are as follows:

  1. Facebook
  2. Google
  3. Twitter
  4. HRDAG
  5. NDAA

Explain the auto.arima() and principal() function.

The auto.arima() function handle both the seasonal and non-seasonal ARIMA model and the principal() function used for rotating and extracting the principal components.

Explain relaimpo and robust package.

This package is used to measure the relative importance of every predictor in the model, and the robust package gives a library of robust methods, including regression.

Explain fitdistr() function?

This function is used to give the maximum likelihood fitting of univariate distribution and defined under the MASS package.

Explain FactoMineR.

The FactoMineR is a package that includes qualitative and quantitative variables. The observations and supplementary variables are also included in these packages.

Why do we use the command – install.packages(file.choose(), repos=NULL)?

This command is used to install an R package from the local directory by browsing and selecting the file.