Google News
logo
R Programing Interview Questions
With just about any program out there, there are going to be advantages and disadvantages. Your interviewer is not necessarily looking for all of the pros and cons, nor is he or she necessarily expecting you to name specific features. Your interviewer is just using this as another question to test the extent of your knowledge, so be sure to know some pros and cons before heading into your interview. For example, you can say that many programmers like R because it’s free, widely accessible, and has built-in functionality via R packages. For disadvantages, you may want to point out that there are some security flaws, and that it is also open-source, which some people even consider a disadvantage. Keep it simple by thinking about what you personally like about R, and what you don’t.
Subset() is used to select the variables and observations and sample() function is used to  generate  a random sample of the size n from a dataset.
Dataframe can contain different type of data but matrix can contain only similar type of data. Here are the different types of data structures in R:

matrix and dataframes
There are various applications available in real-time. These applications are as follows :
 
* Google
* Twitter
* Facebook
* HRDAG
* NDAA
RStudio is an integrated development environment which allows us to interact with R more readily. RStudio is similar to the standard RGui, but it is considered more user-friendly. This IDE has various drop-down menus, windows with multiple tabs, and so many customization processes. The first time when we open RStudio, we will see three Windows. The fourth Window will be hidden by default.
This is the package which is loaded by default when R environment is set. It provides the basic functionalities like input/output, arithmetic calculations etc. in the R environment.
Logistic regression deals with measuring the probability of a binary response variable. In R the function glm() is used to create the logistic regression.
General format is :
 
Mymatrix< - matrix (vector, nrow=r , ncol=c , byrow=FALSE,
dimnames = list ( char_vector_ rowname, char_vector_colnames))
Use the code
myTable = data.frame()
edit(myTable)
The applied family of functions is a built-in family which appears with the built-in packages in R. It is already installed in it. 
 
It allows us to manipulate data frames, vectors, arrays, etc. It works more effectively than loops and also gives better performance from them which is faster at the execution level. It reduces the need for explicitly creating a loop in R.   
 
The list of the apply family are as follows :
 
apply() function : It helps to apply a function on rows or columns of a data frame. 
Syntax : apply()
 
lapply() function : It takes a list as an argument and applies a function to each element of the list by looping. 
Syntax : lappy()
 
sapply() function : It is more advanced version than lappy() however it works same as lappy(). It also takes a list as an argument and applies a function to each element of the list by looping. The only difference is in output generalization. Where lappy() returns a list as an output every time, sapply returns certain algorithms as output.
Syntax :  sapply()
 
tapply() function : It can be applied to vectors and factors. The data which contain different subgroup and we have to apply a specific function on each subgroup that time we can use it. 
Syntax : tapply()
 
mapply() function : It is a multivariate version of the sapply() function where we apply the same function to multiple arguments.
Syntax : mapply()