Sure! Here's a simple R language quiz with explanations:
What function is used to calculate the mean (average) of a set of numbers?
median()
mean()
sum()
max()
Correct Answer: B) mean()
Explanation: The mean()
function in R calculates the average of a set of numbers.
Which of the following functions is used to generate a sequence of numbers?
numbers()
seq()
range()
sequence()
Correct Answer: B) seq()
Explanation: The seq()
function is used to generate a sequence of numbers.
What function is used to find the maximum value in a vector?
maximum()
max()
maximum_value()
max_value()
Correct Answer: B) max()
Explanation: The max()
function in R is used to find the maximum value in a vector.
Which function is used to create a scatter plot in R?
scatterplot()
plot()
scatter()
scatter_plot()
Correct Answer: B) plot()
Explanation: The plot()
function in R can be used to create scatter plots among other types of plots.
How can you access the fifth element of a vector named data
in R?
data[5]
data{5}
data.5
data(5)
Correct Answer: A) data[5]
Explanation: In R, you can access elements of a vector using square brackets notation, like data[5]
to access the fifth element.
Feel free to expand the quiz with more questions or topics as needed!