-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path260316.R
More file actions
87 lines (57 loc) · 669 Bytes
/
Copy path260316.R
File metadata and controls
87 lines (57 loc) · 669 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
a=c(-2.456, 3.6789, 5.23445676)
ceiling(a)
floor(a)
trunc(a)
round(a)
sum(k_score)
mean(k_score)
max(k_score)
min(k_score)
range(k_score)
var(k_score)
sd(k_score)
rank(k_score)
x
x1 x2
a 3 4
b 3 3
c 3 2
d 3 1
e 3 2
f 3 3
g 3 4
h 3 5
i 3 6
j 3 7
k 3 8
apply(x,2, mean)
row.sums = apply(x,1,sum)
row.sums
x<-matrix(1:9, c(3,3))
x
apply(x,1,max)
apply(x,2,max)
a=rep(0,12)
a
b<-rep(NA,10)
b
xm2=x[-c(1,12)]
xm2
xx=x[x!150]
xx
xp=x[x>=150]
xp
g=array(1:24, c(4, 3, 2))
g
x=c(1,-2,-3,4,5)
pos=rep(0,5)
for(i in 1:5) {
if(x[i]>0) pos[i]=1
else pos[i]=0
}
print(pos)
mean(x,na,rm=TRUE)
xx=na.omit(x)
xx
attr(, "na.action")
attr(, "class")