CHAPTER ONE : DATA MANAGEMENT IN R

In this chapter we will cover a number of function, commands and packages used for data managment in R

Data Types iN R

There are six different data types in R including:

  • Vectors
  • Matricces
  • Arrays
  • Data frame
  • List
  • Factors

Vectors

Vectors are the fundamental components for all data types in R , based on the scale of measurements,they can be categorized into different components including:

  1. Charater
  2. Ordered
  3. Factors
  4. integers
  5. Numeric
  6. Logical

Example 1

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

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)