Hello Friends, Welcome to the second article of series named Random Questions & Answers on R. 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 bar diagram in R using base package ?
Ans : A bar diagram is created in R by using barplot ( ) function.
Q.2. How to create a boxplot in R using base package?
Ans : A boxplot is created in R by using boxplot ( ) function.
Q.3. How to perform addition of two matrices in R ?
Ans : Matrix addition is performed in R by using + operator.
Q.4. What will be the output of R code : print(eval(2 + 3));
Ans : 5
Q.5. How to convert a matrix object into dataframe ?
Ans : A matrix object is converted into dataframe in R by using as.data.frame ( ) function.
Q.6. What is the purpose of using ggplot2 package in R ?
Ans : ggplot2 is used for data visualization in R.
Q.7. How to calculate median of numeric vector x = c(2, 5, 1, 6, 7) ?
Ans : Median of a numeric vector is calculated in R by using median ( ) function.
Q.8. How to calculate median of numeric vector x = c(2, 5, 1, 6, 7, NA) ?
Ans : Median of a numeric vector in presence of missing values is calculated in R by using median ( ) 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, 8, 2, 4, 7) ; median(x)
Ans : NA
Q.10. Suppose you have a dataframe in R with 1000 rows and 15 columns. How will you access element of 100th row and 3rd column ?
Ans : If a is dataframe object in R, Element of 100th row and 3rd column of a is accessed by a[100,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
0 Comments
Please, Do not enter any spam link in the comment box