Hello Friends, Welcome to the third 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. Is R code : x = c(2, 3 5, 4)/2; is error free ?
Ans : No
Q.2. How to create a scatter diagram in R using base package ?
Ans : A scatter diagram is created in R by using plot ( ) function.
Q.3. How to install a new package in R ?
Ans : A new package is installed in R by using command install.packages("package_name")
Q.4. What will be the output of R code : x = c(2, 3, 5)*2 ; print(x);
Ans : 4 6 10
Q.5. What will be the output of R code : x = c(2, 3, 5, 4)*c(3, 2) ; print(x);
Ans : 6 6 15 8
Q.6. What is the purpose of using lubridate package in R ?
Ans : lubridate is used to work more with dates and times in R.
Q.7. How to calculate natural logarithm of a number in R ?
Ans : Natural logarithm of a number is calculated in R by using log ( ) function.
Q.8. How to calculate sum of numeric vector x = c(2, 5, 1, 6, 7, NA) in R?
Ans : Sum of a numeric vector in presence of missing values is calculated in R by using sum ( ) 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) ; sum(x)
Ans : NA
Q.10. How to create a histogram in R using base package?
Ans : A histogram is created in R by using hist ( ) function.
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