in this chapter we will cover a number of functions and command and packaged using in R
There are 6 differnt data types in r inclouding:
Vectors are the fundamental components for all data types in r based on the scale of measurement, they can categorized into six different components including:
data("Titanic")
Titanic
## , , Age = Child, Survived = No
##
## Sex
## Class Male Female
## 1st 0 0
## 2nd 0 0
## 3rd 35 17
## Crew 0 0
##
## , , Age = Adult, Survived = No
##
## Sex
## Class Male Female
## 1st 118 4
## 2nd 154 13
## 3rd 387 89
## Crew 670 3
##
## , , Age = Child, Survived = Yes
##
## Sex
## Class Male Female
## 1st 5 1
## 2nd 11 13
## 3rd 13 14
## Crew 0 0
##
## , , Age = Adult, Survived = Yes
##
## Sex
## Class Male Female
## 1st 57 140
## 2nd 14 80
## 3rd 75 76
## Crew 192 20
x<-c(12,11.5, 12.5, 13.5, 21,23,24,21,25,26)
plot(density(x))
hist(x)
boxplot(x)
y<-c(T,T,T,T,F,F,F,F,T,F)
table(y)
## y
## FALSE TRUE
## 5 5
barplot(y)