-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlekcja2.R
More file actions
50 lines (36 loc) · 708 Bytes
/
Copy pathlekcja2.R
File metadata and controls
50 lines (36 loc) · 708 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
wektor <-c(0,1,2,3,4,5,6,7,8,9)
print(wektor)
cat(wektor)
wektor[1]
wektor[11] # nie ma takiego elementu
wektor[-3] # pominięcie wektora o 3 indeksie
wektor[c(1,4,10)]
wektor[3] <-5
wektor[3]
wektor[c(4,5,6)] <- 7
head(wektor, 3)
tail(wektor, 3)
length(wektor)
min(wektor)
max(wektor)
mean(wektor)
sum(wektor)
prod(wektor)
prod(wektor[-1])
wektor*2
max(wektor*2)
wektor1 <- 0:9
?seq
wektor2 <- seq(from = 0, by = 2, length.out = 11)
typeof(wektor2);mode(wektor2)
wektor3 <- rep(0,2)
wektor4 <-c(1L,1.0,"1");typeof(wektor4)
is.numeric(wektor4)
wektor4prim <- as.numeric(wektor4)
is.numeric(wektor4prim)
wektor
wektor>=5
5<=wektor
wektor[1:5]<wektor[6:10]
wektor %% 2 == 0
wektor[wektor %%2==0]