0% found this document useful (0 votes)
30 views2 pages

R Programming Short Answers

Uploaded by

misoxyash2205
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views2 pages

R Programming Short Answers

Uploaded by

misoxyash2205
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

R Programming – Very Short Answers

1. Define R programming
R is an open-source programming language and software environment used for statistical
computing, data analysis, and graphical representation.

2. List out any five features of R


Open-source, cross-platform, data handling & storage, graphical facilities, wide package
ecosystem.

3. What are the applications of R?


Data science, machine learning, statistical modeling, data visualization, bioinformatics.

4. What are the different data types in R?


Numeric, Integer, Character, Logical, Complex, Raw.

5. Demonstrate the simple 3×3 matrix.


matrix(1:9, nrow=3, ncol=3, byrow=TRUE)

6. Define order of a Matrix.


The order is given by rows × columns of the matrix.

7. What are the 7 measures of central tendency?


Mean, Median, Mode, Geometric Mean, Harmonic Mean, Midrange, Trimmed Mean.

8. Define Transpose of a matrix.


Transpose is obtained by interchanging rows and columns of a matrix (A■).

9. Explain factor variable?


A factor is a variable that represents categorical data (e.g., gender, colors).

10. List out the characteristics of a data frame.


Tabular form, columns as vectors, different data types allowed, same column length, row/column
names.

11. Define Vector with an example


Vector is a sequence of elements of same type. Example: v <- c(10, 20, 30)

12. What are the different values that can be assigned to a numeric data type in R?
Integers, decimals, positive numbers, negative numbers, real numbers.

13. Explain RStudio.


RStudio is an IDE for R providing script editor, console, plots, debugging, and package tools.

14. Write an R program to reverse the order of given vector.


v <- c(1, 2, 3, 4, 5) rev(v)

15. How to create a Matrix in R?


Using matrix() function. Example: matrix(1:6, nrow=2, ncol=3)

16. Define R Array?


Array is a data structure that stores data in more than two dimensions.

17. Difference between data frame and a matrix in R?


Data frame → different data types allowed per column. Matrix → only one data type for all
elements.

18. Explain the use of length() function?


length() returns the number of elements in an object. Example: length(c(1,2,3)) → 3.

19. Define the structure of a data frame using str() function.


str() displays the internal structure (data types & sample values) of a data frame.

20. Explain Argument matching


In R, function arguments are matched by position, exact name, or partial name.

You might also like