NEP -R PROGRAMMING

PROGRAM 1 PROGRAM 2 PROGRAM 3 PROGRAM 4 PROGRAM 5 PROGRAM 6 PROGRAM 7 PROGRAM 8 PROGRAM 9 PROGRAM 10

PART B

PROGRAM B1 PROGRAM B2 PROGRAM B3 PROGRAM B4 PROGRAM B5 PROGRAM B6 PROGRAM B7 PROGRAM B8 . . .

5.

 
  
 
 
 #Write a R program for calculating cumulative sums, and products minima,maxima


#   cumulative maxima

# Creating vectors
x1 <- c(5, 3, 2, 6, 3, 4)
x2 <- c(-4, 6, 3)


print("MIN")
print(cummin(x1))
print(cummin(x2))
 
print("MAX")
print(cummax(x1))
print(cummax(x2))

print("SUM")
print(cumsum(x1))
print(cumsum(x2))