You are on page 1of 4

Name-Shreya Datir

Roll No-32
Division-CHB

Data Science Home Assignment 03

Exercise 3

Code 1 :

w = seq(1,40,3)
w

Output :
Code 2:

w = rep(5,10)
w

Output:

Code 3:

x = c(1,5,2)
y = c(3,7,9)
z = c(y,x)
print(z)
a = c(4,3,2)
b = c(a,y)
print(b)
c = max(y)
c
d = min(x)
d

Output:

Code 4:

x = c(1,5,2,3,7,6,8)
y = x^2
y
z = 1/x
z
w = log(x)
w

Output:
Code 5:

age = c(22,27,31,41,30,25,19,20,23,35)
a = age[4]
a
age30 = age[age>30]
age30
l = length(age)
l
b = age[c(8,9,10)]
b
c = age[c(-5,-7)]
c

d = age[age>20]
d

age2 = (20:25)
age2

Output :

You might also like