manish
manish
[1,] 7 18 -2 11
[2,] -18 3 33 1
[3,] 9 -4 0 21
> r=t(a);r
[1,] 7 -18 9
[2,] 18 3 -4
[3,] -2 33 0
[4,] 11 1 21
> A=matrix(c(2,4,5,9,3,8),byrow=T,ncol=2);A;B=matrix(c(4,9),byrow=T,ncol=1);B
[,1] [,2]
[1,] 2 4
[2,] 5 9
[3,] 3 8
[,1]
[1,] 4
[2,] 9
> y=A*B;y
> K=A%*%B;K
[,1]
[1,] 44
[2,] 101
[3,] 84
> a=matrix(c(12,4,5,8,23,18),byrow=T,ncol=2);a;b=matrix(c(32,14,5,7,3,8),byrow=T,ncol=2);b
[,1] [,2]
[1,] 12 4
[2,] 5 8
[3,] 23 18
[,1] [,2]
[1,] 32 14
[2,] 5 7
[3,] 3 8
> D=a+b;D
[,1] [,2]
[1,] 44 18
[2,] 10 15
[3,] 26 26
> R=matrix(c(7,18,-2,-16,3,55,9,-4,0),byrow=T,ncol=3);R
[1,] 7 18 -2
[2,] -16 3 55
[3,] 9 -4 0
> B=solve(R);
>B
> R%*%B
> round(R%*%B,4)
[2,] 0 1 0
[3,] 0 0 1
> x=c(60,28,124)
> y=c(72,21,127)
> z=c(45,35,140)
> A=cbind(x,y,z);A
x y z
[1,] 60 72 45
[2,] 28 21 35
> G=7*A;G
x y z
> x=c(4,6,2,7,1,8)
> y=c(4,8)
> d=x+y
>d
[1] 8 14 6 15 5 16
> u=x/y;u
> o=x*y;o
[1] 16 48 8 56 4 64
> state=c(punjab,harayana,u.p,gujarat,bhihar,karnataka)
> state=c("punjab","harayana","u.p","gujarat","bhihar","karnataka")
> wheat=c(728,1753,1475,1980,2210,2270)
> d=data.frame(state,wheat)
>d
state wheat
1 punjab 728
2 harayana 1753
3 u.p 1475
4 gujarat 1980
5 bhihar 2210
6 karnataka 2270
> d$state[3]
[1] "u.p"
> d$state[3];d$wheat[3]
[1] "u.p"
[1] 1475
> x=c(31,26,36,14,45,28,39,51,33,34,21,11,12,35,20)
>x
[1] 31 26 36 14 45 28 39 51 33 34 21 11 12 35 20
> y=c(36,39,51,12);y
[1] 36 39 51 12
> z=c(31,26,36,45,28,39,51,33,34,35);z
[1] 31 26 36 45 28 39 51 33 34 35
> x[c(1,3)]
[1] 31 36
> x[c(1,3,7,8,13)]
[1] 31 36 39 51 12
> x[x>25]
[1] 31 26 36 45 28 39 51 33 34 35
> marksofA=c(65,89,75,95,89);marksofA
[1] 65 89 75 95 89
> marksofB=c(52,69,70,81,85);marksofB
[1] 52 69 70 81 85
> d=data.frame(marksofA,marksofB)
>d
marksofA marksofB
1 65 52
2 89 69
3 75 70
4 95 81
5 89 85
> age=c(11,10,14,17,19,20,22,21);age
[1] 11 10 14 17 19 20 22 21
> age[age>15]
[1] 17 19 20 22 21
> age[age<20]
[1] 11 10 14 17 19
> y=c(18,25,age,21,24);y
[1] 18 25 11 10 14 17 19 20 22 21 21 24
>
> a=matrix(c(7,18,2,-16,3,55,9,-4,0);a
> a=matrix(c(7,18,2,-16,3,55,9,-4,0),byrow=T,ncol=3);a
[1,] 7 18 2
[2,] -16 3 55
[3,] 9 -4 0
> G=10*a;G
[1,] 70 180 20
[2,] -160 30 550
[3,] 90 -40 0
> A=matrix(c(6,10,15,19,34,81),byrow=T,ncol=2);A;B=matrix(c(3,4,5,10,39,8),byrow=T,ncol=2);B
[,1] [,2]
[1,] 6 10
[2,] 15 19
[3,] 34 81
[,1] [,2]
[1,] 3 4
[2,] 5 10
[3,] 39 8
> D=A+B;D
[,1] [,2]
[1,] 9 14
[2,] 20 29
[3,] 73 89
> a=matrix(c(17,18,-2,-16,20,55,9,-14,10),byrow=T,ncol=3);a
[1,] 17 18 -2
[2,] -16 20 55
[3,] 9 -14 10
> R=t(a);R
[1,] 17 -16 9
[2,] 18 20 -14
[3,] -2 55 10