Labour Law

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

#1 Write a R code to create a sequence of numbers between 1 to 10

sequence(10)
seq(1,10)

#code to create a sequence of numbers between 1 to 10

#2

seq(10,1) #code to create a sequence of numbers between 10 to 1

#3

seq(from=2,to=10,by=2) #code to create a sequence of all the even numbers


between 1 to 10

#4

seq(from=1,to=10,by=2.5) #code to create a sequence of numbers between 1 to


10 each having difference of 2.5

#5

rep(3,10) #code to create a sequence of numbers with 3 repeated 10 times

#6

x=18;y=12
x+y

#code for x+y

x-y

#code for x-y

x*y

#code for x*y

x/y

#code for x/y

as.integer(x/y) #integer part of x/y


x%%y
x^y

# x to the power y

((x-y)/3)

#x-y/3

x/0

#x divided by 0

0/0

#o divided by 0

"eighteen"/12
(x^2)+(2*x)+(32*log(x,10))+exp(x)+(sqrt(x+2*y))

#7
x=18
y=log(x, base=exp(1))

#8
log10(x)

#9
sqrt(88)

#10
factorial(8)

#11
runif(5)

#12
abs(18/-12)

#13
date()

#14
difftime("2008-07-05","1992-08-15")

#15

heightinches<-c(68, 65, 70, 71, 69)


heightinches*2.5
summary(heightinches)
var(heightinches)
sd(heightinches)
length(heightinches)
sort(heightinches,decreasing = FALSE)
sort(heightinches,decreasing = TRUE)

You might also like