CHAPTER ONE : DATA MANAGEMENT IN R

in this chapter we will cover a number of functions, commands and packages used for data management in R

Data types in R

there are six deferent data types in R including

  • vectors
  • matrices
  • data frames
  • lists
  • factors

Vectors

vectors are the fundamental components for al data types 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

Example 1

x<-c(11,11.5,12.5,13.5,21,23,24,21,25,26)
 y<-c(T,T,T,T,F,F,F,F)
hist(x)

boxplot(x)

Example 2

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