Question

Discuss different data structures in R. Write program using R for the following tasks:

(i) Computation of income tax of a vector of size 10, consisting of the total annual income of 10 differentpersons. The tax computation should be 10%, if annual income is below 5 lakhs and 20% if it is above 5 lakhs.

(ii) Matrix addition, subtraction and multiplication

(iii) Finding inverse of a matrix

29 Nov 2023
Answer :
Word Count : 321

Sure, I'll break down the different data structures in R and provide code for the tasks you've mentioned.

### Data Structures in R:

R supports various data structures such as vectors, matrices, arrays, lists, and data frames.

1. Vectors: A vector is a collection of elements of the same data type. It can be created using the `c()` function.
   
   ```R
   # Creating a vector
   income_vector <- c(300000, 450000, 600000, 350000, 800000,

__________ ____ __________ ________ ________ __________ __________ __________.
_____ ___ ______ ________ ___.
__________ _____ _______ ____ ______ ___.
________ ________ _____ ____ ________ ________.
_________ _________ ____ _____ ___ _________ ________ ________ ___ ______ ________ _______.
_____ ____ _________ ____ _________ _______.
______ _____ ______ __________ _________ __________ _______ ___ ____ _____.
__________ __________ ____ ________ ______.
______ ______ ___ _________ _____ _______ __________.
_______ ________ __________ _______ ________ _____ _______ ______ __________ ______.
______ _________ _____ __________ ____ _________ ______ ______ ____.
________ ______ ________ __________ _____ _____ _______.
_____ ____ _____ ____ __________ _________ __________ _______ ___ _____ ________ __________.
_________ ________ ___ ____ _______ _____ ________ ______ _______.
___ _________ _____ _________ ________ _______.
___ ________ _____ _________ _______ ________ _______ ___ ____ ___ _______ _________.
_____ _______ ________ _____ ______ ______ __________.
___ ________ _________ _____ ___ _________ ________ ___ _____.
__________ __________ _______ _______ _____ __________ _________ _________.
________ ________ __________ ___ ____ _______ ______ _________ _____ ______ __________ ______.
_____ ________ _____ _____ _______ __________ _______ _______ _____ __________.
_______ _______ ____ ____ _______ ____ ______.
__________ _____ _____ __________ ________ _____ _______ ______ ___.
__________ ______ __________ _____ _________ _________ ____ ______ ___ _____.
______ ____ _______ _________ ________ _____.
_______ ____ __________ _____ _____ ______.
___ _______ ____ ____ __________ ______.
_________ ____ _______ ______ _______ _________ ____ ____ _______ ________ ______.
________ ___ _________ ___ __________ _________ _________.
______ _______ ____.
IGNOU ACADEMY
Your IGNOU journey, made easier.
  • Solved Assignments
  • Study Notes
  • Guess Papers
  • Question Papers
Skip in 10
Top
📞
Call Support Instant phone assistance IGNOU MCS 226 2023 - Discuss different data structures in R. Write program using R for the | IGNOU Academy
→
🟢
WhatsApp Chat Fast live messaging
→
Email Us Business enquiries & support
→