>>>>>>R Language Interview Questions
##### How can you combine 2 vectors?
Vectors can be combined from 2 to 1 by using the c() function Example.
> first <- c(1,2,3,4)
> second <- (“a”, “b”, “c”)
> third <- c(first, second)
> print(third)
 “1” “2” “3” “4” “a” “b” “c”
##### What is the difference between Matrix and an array ?
The matrix can have only 2 dimensions whereas an array can have as many dimensions as you want. Matrix is defined with the help of data, number of rows, number of columns and whether the elements are to be put in row-wise or column-wise.
In array, you need to give the dimension of the array. An array can be of any number of dimensions and each dimension is a matrix. For example, a 3x3x2 array represents 2 matrices each of dimension 3x3.
##### What is the difference between a matrix and a dataframe?
A data frame can contain vectors with different inputs and a matrix cannot. (You can have a data frame of characters, integers, and even other data frames, but you can't do that with a matrix. A matrix must be all the same type.)
So, the data frame can have a different vector of character, numbers, logic, etc. and it is still cool. But, for a matrix, you need only one type of data type.
##### Explain general format of Matrices in R?
General format is >Temp_matrix< – matrix (vector, nrow=r ,ncol=c , byrow=FALSE, dimnames = list ( char_vector_ rowname, char_vector_colnames))
##### Define repeat.
The repeat loop executes a sequence of statements multiple times. It doesn’t put the condition at the same place where we put the keyword repeat. Example
> name <- c(“Pappu”, “John”)
> temp <- 5
> repeat {print(name)
temp <- temp+2
if(temp > 11) {
break
}
}
So, this will return the name vector 4 times. First, it prints the name and then increase the temp to 7 and so on.

##### Description
• R Language Interview Questions can be used to give quizzes by any candidate who is preparing for Data Scientist
• This R Language Questions section will help you test your analytical skills in a tricky method, thereby giving you an edge over other students
• All candidates who have to appear for the IT Officer Entrance exam can also refer to this mcq section.
• You can also get access to the R Language Interview ebook.
• R Language Questions can be used in the preparation of JRF, CSIR, and various other exams.