Looking For Anything Specific?

Random Questions & Answers on R || Article - 1

Statistical Knowledge | Random Questions & Answers on R | Article - 1

Hello Friends, Welcome to my new series of Articles named Random Questions & Answers on R and it is the first article of this series. The main motto of this series of articles is to provide Questions and their Answers related to R-software that you must know if you are a student of Statistics and want to work or already working on R. These articles will also help you if you are preparing for any corporate sector interview where R is mandatory.  So, without wasting the time, Just dive into this article and learn the following 10 Qusetions from here 😊

Q.1. How to create a matrix object in R ?

Ans : A matrix object is created in R by using matrix ( ) function.


Q.2. How to create a dataframe in R ?

Ans : A dataframe is created in R by using data.frame ( ) function.


Q.3. How to perform matrix multiplication in R ?

Ans : Matrix multiplication is performed in R by using %*% operator.


Q.4. What will be the output of R code : x = c(1, 2, "a", 4) ; print(x)

Ans : "1"  "2"  "a"  "4"


Q.5. How to convert a numeric vector into a character vector ?

Ans : A numeric vector is converted into character vector in R by using as.character ( ) function.


Q.6. Give a package name of R that is basically used to manipulate dataset ?

Ans : dplyr is basically used to manipulate dataset.


Q.7. How to calculate mean of a numeric vector ?

Ans : Mean of a numeric vector is calculated in R by using mean ( ) function.


Q.8. How to calculate mean of a numeric vector, if there are missing values in vector ?

Ans : Mean of a numeric vector in presence of missing values is calculated in R by using mean ( ) function and also pass one more argument na.rm and set its value as TRUE .


Q.9. What will be the output of following R code : x = c(1, 2, NA, 3) ; mean(x)

Ans : NA


Q.10. Suppose you have 3 by 3 matrix object in R. How will you access element of 2nd row and 3rd column ?

Ans : If a is matrix object in R, Element of 2nd row and 3rd column of a is accessed by a[2,3]



So, That's all about 10 questions on R in this article. In next article we'll learn 10 more questions on R-Software. Till then, Good Bye !

Happy Learning ! ðŸ˜Š

If you find any mistake or have any suggestions,  just let me know using Suggestion Form given below (for mobile users) or in sidebar (for laptop users)Thank you in Advance ! ðŸ˜Š

Next Article : Link

Share this Article Via

Post a Comment

0 Comments