#How to load dataset
#Download data
#Unzip data
#Copy to the working directory
#Load data
iris = read.csv("iris.csv")
print(iris)
#check korte chaile (==), update korte chaile (=)
setosa_data = iris[iris$variety == "Setosa", ]
setosa_data
#Condition
setosa_data_SL_5 = setosa_data[setosa_data$sepal.length >= 5.0, ]
setosa_data_SL_5
NA
setosa_data_SL_5 = setosa_data[ , c(1,2,4,5)]
setosa_data_SL_5
plot(iris$petal.length, iris$sepal.width)
variety_color= as.numeric(factor(iris$variety))
variety_color
[1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
[51] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
[101] 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
plot(iris$petal.length, iris$sepal.width)
###Change in BAse
plot(iris$petal.length, iris$sepal.width,
col = variety_color,
pch = 3,
#pch SHAPE CHANGE
cex = 1,
#cex icon size
xlim = c(1, 10),
ylim = c(2, 6),
xlab = "Sepal Length",
ylab = "Sepal Width",
#x lab label name
main = "Visualization of Sepal Length and Sepal Width",
#main caption name
col.main = "blue",
col.axis = "red",
col.lab = "green",
cex.main = 1.5,
cex.axis = 1,
cex.lab = 1.5
# cex size change
)
NA
##Line Plot
exam_score = data.frame(
ID = c(1,2,3,4,5),
Name = c("Aa","Bb","Cc","Dd","Ee"),
Age = c(20,23,34,45,66),
Score = c(100,50,250,420,450)
)
plot(exam_score$ID, exam_score$Score, type="l")
hist(iris$sepal.length, main = "Histogram plot",xlab = "Sepal Length", col = "blue")
#Box Plot
boxplot(iris$sepal.length, main = "Histogram plot",xlab = "Sepal Length", col = "red")