You are on page 1of 11

Progressive Education Society’s

Modern College of Engineering, Pune


MCA Department
Data Science Tutorial
**********************************************************************************
Class : SY-MCA Shift : II Roll Number :52133

Name: kshitija kamble Assignment No : 2 Date of Implementation : 25/09/2021

**********************************************************************************

Tutorial NO: 2

Q.1.Write a R Program to

1. Create a vector of numeric and character type

Program with output:-

2. Display first three elements of the vector


Program with output:-

3. Create a matrix of numeric type


Program with output:-

4. Display third column values of the matrix


Program with output:-

5. Create a data frame to represent employee data


Program with output:-

6. Create a list to contain all above created objects


Program with output:-

Q.2 VAT has different rate according to the product purchased. Imagine we
have three
different kind of products with different VAT applied:

Write a chain to apply the correct VAT rate to the product customer bought
and calculate a price.

Program with output:-


Q.3.Consider the Salary_data as an object which is of class data.frame

Salary_data(First_Name, Last_Name, Grade, Location, ba, ms)

Write a R code

Program with Output:-


i) To display First 5 rows
ii) To remove rows which has location as ‘Mumbai’

iii) Create a subset with all details of employees of Mumbai with ba more
than 15000

iv) Display rows 1,5,8 and columns 1 and 2


v) Add a new variable to Salary_data containing values as 5% of ba.

You might also like