CHAPTER ONE: DATA MANAGEMET IN R

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

DATA TYPES IN R

there are six different data types in R including:

  • Vectors
  • Matrices
  • Arrays
  • Data frames
  • lists
  • Factors

Vectors

Vectors are fundamental components in all data types in R. Based on the scale of measurement, they can be categorized into six different components including:

  1. Character
  2. Orders
  3. Factors
  4. Integers
  5. numeric
  6. logical

Example 1

x<-c(12,11.5,12.5,13.5,21,23,24,21,25,25)
plot(density(x))

hist(x)

boxplot(x)

Example 2

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