how to install packages in R.
use “install.packages” to install packages in R to make italic statistics to make bold probability to add code
x<-c(21,12,13,14,15)
mean(x)
## [1] 15
median(x)
## [1] 14
mode(x)
## [1] "numeric"
sd(x)
## [1] 3.535534
var(x)
## [1] 12.5
summary(x)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 12 13 14 15 15 21
# data visualization
y<-c(12,12,12,13,21,23,24,25,18,19,20,21)
windows()
hist(y)
windows()
boxplot(y)
z<-c(12,12,12,13,21,23,24,25,18,19,20,21,89)
windows()
boxplot(z)
windows()
plot(density(y))
polygon(density(y),col = "red")
windows()
hist(y,col = "green",xlab = "age",ylab = "weight",main = "nutrition group")
windows()
boxplot(y,col = "blue",xlab = "age",ylab = "weight",
main = "nutrition group")
windows()
plot(density(y),col="cyan",xlab="age",ylab="weight","nutrition group")
polygon(density(y),col = "yellow",border="black",xlab = "age",ylab = "weight", main = "nutrition group")