-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathR3.R
More file actions
51 lines (34 loc) · 768 Bytes
/
R3.R
File metadata and controls
51 lines (34 loc) · 768 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#=====modes====.!
mode(1.234)
mode(c(5,6,7,8))
mode("India")
mode(factor(c("UP","MP")))
mode(lis("india","usa"))
mode(data.frame(x=1:2,y=c("INDIa","Usa")))
mode(print)
#=====lists examples
x1<-matrix(nrow=2,ncol=2,data=1:4,byrow=T)
x2<-matrix(nrow=2,ncol=2,data=5:8,byrow=T)
x1
x2
x1+x2
matrixlist <-list(x1,x2)
matrixlist
matrixlist[1]
#accessing different objects
z1 <- list(C("water","juice","lemonade"))
Rep(1:4,each=2),
matrix(data=5:8,nrow=2,ncol=2,byrow=T)
z1
#============Adding elements to the list
mat<-matrix(1:4, nrow=2,ncol=2)
my_list_new=
#===difference between dataframe and list
x3<-list(1:6)
x3
dim(x3)<-c(6)
mode(x3)
#===creating matrix of the list
ab <-1:10
dim(ab)<-c(2,3)
mode(ab)