Home Python C Language C ++ HTML 5 CSS Javascript Java Kotlin SQL DJango Bootstrap React.js R C# PHP ASP.Net Numpy Dart Pandas Digital Marketing

R Quiz:


Sure! Here's a simple R language quiz with explanations:

  1. What function is used to calculate the mean (average) of a set of numbers?

    • A) median()
    • B) mean()
    • C) sum()
    • D) max()

    Correct Answer: B) mean()

    Explanation: The mean() function in R calculates the average of a set of numbers.

  2. Which of the following functions is used to generate a sequence of numbers?

    • A) numbers()
    • B) seq()
    • C) range()
    • D) sequence()

    Correct Answer: B) seq()

    Explanation: The seq() function is used to generate a sequence of numbers.

  3. What function is used to find the maximum value in a vector?

    • A) maximum()
    • B) max()
    • C) maximum_value()
    • D) max_value()

    Correct Answer: B) max()

    Explanation: The max() function in R is used to find the maximum value in a vector.

  4. Which function is used to create a scatter plot in R?

    • A) scatterplot()
    • B) plot()
    • C) scatter()
    • D) scatter_plot()

    Correct Answer: B) plot()

    Explanation: The plot() function in R can be used to create scatter plots among other types of plots.

  5. How can you access the fifth element of a vector named data in R?

    • A) data[5]
    • B) data{5}
    • C) data.5
    • D) 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!


Advertisement





Q3 Schools : India


Online Complier

HTML 5

Python

java

C++

C

JavaScript

Website Development

HTML

CSS

JavaScript

Python

SQL

Campus Learning

C

C#

java