-
Notifications
You must be signed in to change notification settings - Fork 0
/
iris_practice.R
53 lines (53 loc) · 1 KB
/
iris_practice.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
53
## Working Directory
getwd()
## Setting working directory
setwd("C:/Users/Administrator/Documents")
## Data Sets existing in base R installation
## Iris data
data(iris)
class(iris)
str(iris)
summary(iris)
dim(iris)
names(iris)
ncol(iris)
nrow(iris)
head(iris)
tail(iris)
iris[1:5,]
iris[1:10,2]
iris[1:10,"Sepal.Width"]
iris$Sepal.Width
summary(iris$Sepal.Length)
mean(iris$Sepal.Length)
median(iris$Sepal.Length)
range(iris$Sepal.Length)
var(iris$Sepal.Length)
sd(iris$Sepal.Length)
quantile(iris$Sepal.Length)
quantile(iris$Sepal.Length,c(0.1,0.4,0.7))
a=c(1,3,5)
a
class(a)
b=c("Ali","Veli","Selami")
b
class(b)
c=c(1L,2L,3L)
c
class(c)
d=c(TRUE,FALSE,TRUE)
d
class(d)
print(a)
hist(iris$Sepal.Length)
plot(density(iris$Sepal.Length))
table(iris$Species)
pie(table(iris$Species))
barplot(table(iris$Species))
cov(iris$Sepal.Length,iris$Petal.Length)
cov(iris[,1:4])
cor(iris$Sepal.Length,iris$Petal.Length)
cor(iris[,1:4])
aggregate(Sepal.Length~Species,summary,data=iris)
boxplot(Sepal.Length~Species,data=iris)
pairs(iris)