CHAPTER ONE : DATA MANAGEMENR IN R

In this chapter we will cover an number of function, commands and packages used in data management in R

Data types in R

There are six different data type in R including:

  • Vector
  • Matrices
  • Arrays
  • Data frames
  • Lists
  • Factors

Vactors

Vectors are the fundamental component for all data type in R based on the scale of measurement,they can be categorized into six different components including:

  1. Character
  2. Ordered
  3. Factors
  4. Integers
  5. Numeric
  6. Logical

R CODE EXAMPLE ONE

x<-c(12,11,5,12,5,13,5,21,23,24,25,26)
plot(density(x))

hist(x)

boxplot(x)

Example two

y<-c(T,T,T,T,F,F,F,F,T,F)
table(y)
## y
## FALSE  TRUE 
##     5     5
barplot(y)