menu

R Programming Basics


1. Which of the following functions is used to install packages in R Programming?

library()

install.packages()

require()

package.install()


2. Which of the following functions is used to calculate the standard deviation of a vector in R Programming?

sd()

median()

var()

mean()


3. Which of the following functions is used to calculate the correlation between two vectors in R Programming?

cor()

cov()

cor.test()

All of the above


4. Which of the following functions is used to apply a function to each element of a vector in R Programming?

apply()

lapply()

sapply()

mapply()


5. Which symbol is used to assign values to variables in R Programming?

=

==

<=

=>


6. Which of the following functions is used to convert a factor variable to a character variable in R Programming?

as.factor()

as.character()

factor()

character()


7.

Which of the following is NOT a data type in R Programming?

Integer

Float

Double

Character


8. Which of the following functions is used to create a density plot in R Programming?

density()

plot()

hist()

boxplot()


9. Which of the following operators is used to concatenate two vectors in R Programming?

+

*

&

c()


10. Which of the following functions is used to generate random numbers in R Programming?

sample()

runif()

rnorm()

All of the above