R Programming Interview Questions and Answers Set 6

51. What is R lists?

Lists are the object which Contains elements of different types – like strings, numbers, vectors and another list inside it. A list can also contain a matrix or a function as its elements. The List is created using list() Function. In other words, a list is a generic vector containing other objects.

For Example, The variable x is containing copies of three vectors n, s, b and a numeric value 3.
n = c(2, 3, 5)
s =  c(“aa”,  “bb”,  “cc”,  “dd”, “ee” )
b = c(TRUE,  FALSE,  TRUE,  FALSE,  FALSE )
x = list( n, s, b, 3)        # x contains copies of n, s, b)

52. Name the functions which helps in importing data from other applications in R?

  • table()
  • readlines()
  • fwf
  • delim()
  • scan()
  • csv()
  • csv2()

53. What is the distribution in R?

R Functions for Probability Distributions. Every distribution that R handles has four functions. There is a root name, for example, the root name for the normal distribution is the norm. This root is prefixed by one of the letters. p for “probability”, the cumulative distribution function (c. d. f.)

54. Explain the programming features of R.

  • Users commonly approach through a command-line interpreter to run the R language.
  • Similar to other programming languages like MATLAB or APL, matrix arithmetic is supported by R.
  • The language’s object system is inclusive of objects such as time-series, geospatial coordinates, and regression models.
  • R also backs productional programming along functions and for few functions, it supports object-oriented programming with generic functions.
  • Apart from being the first choice in the field of statistical computing and research, R is capable of operating as a general matrix calculation toolbox.



55. Explain RStudio.

RStudio is defined as the open-source, cost-free, integrated development environment for the computing language R. This integrated environment is written in C++ programming language and for graphical user-interface, adopts Qt framework. RStudio runs on the platform as a desktop application and RStudio server at the same time are available in both open source and commercial editions.

56. What is a variable assignment?

Variable assignment is derived through the assigned values with the help of right, left or equivalent to the operator. These can either be printed using print() or cat() function respectively. The later option combines various items into a continuous print output.

57. Explain statistical functions performed by R.

The statistical analysis takes place by using numerous inbuilt functions, most of the concerned functions are a part of R basic package, The R vector is considered as the input along with the arguments in order to produce results.

Mean: The function means “mean()” is calculated by dividing the sum of all the values with the number of values in the data presented.

Median: Median function “Median()” is the middle most value present in the entire data series.

Mode: the value of the highest occurrence which takes place in the data set is termed as a mode. When compared with mean and median, a mode can either be a character or a numerical. R language does not have any fundamental in-built function to calculate mode. This statistical function takes the vector as prime input and provides mode solution as an output.

57. Define Cluster.stats() ?

It is defined in fpc package which provides a method for comparing the similarity of two clusters solution using different validation criteria.

58. What are the advantages of R?

The advantages are:-

  • It is used for managing and manipulating of data.
  • No license restrictions
  • Free and open source software.
  • Graphical capabilities of R are good.
  • Runs on many Operating system and different hardware and also run on 32 & 64-bit processors etc.

59. What is logistic regression?

Logistic regression is used to predict the binary outcome from the given set of continuous predictor variables.

60. What makes a valid variable name in R?

A valid variable name consists of letters, numbers and the dot or underlines characters. The variable name starts with a letter or the dot not followed by a number.