-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWoche1-neu.R
52 lines (37 loc) · 847 Bytes
/
Woche1-neu.R
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
2+2
sqrt(5)
barplot(c(1,2,3))
var1 = 5
var1 = c(1,2,3)
var2 = factor(c("rot", "gruen", "blau"))
mean(var1)
mean(var2)
dat = data.frame(var1 = var1, var2 = var2)
dat$var1
str(dat)
#########################################
x = rlnorm(500)
hist(x, breaks = 50)
y = replicate(2000,mean(rlnorm(2000)))
hist(y, breaks = 50)
#########################################
library(EcoData)
str(titanic)
titanic$pclass = factor(titanic$pclass)
x = table(titanic$pclass)
x
barplot(x)
barplot(x, las = 2, horiz = T, col = c("darkred"))
x = table(titanic$sex)
x
barplot(x)
hist(titanic$age)
hist(titanic$age[titanic$pclass == 3])
mean(titanic$age, na.rm = T)
median(titanic$age, na.rm = T)
var(titanic$age, na.rm = T)
sd(titanic$age, na.rm = T)
quantile(titanic$age, na.rm = T)
boxplot(titanic$age)
library(moments)
skewness(titanic$age, na.rm = T)