Variables in R:

  • you do not need to declare variables or their type, just assign the value
    x <- 10
  • you can change type of variable by just reassigning of a new value of another type
  • variable can be an array or matrix (arrray of arrays) – also no need to declare anythingvector: a <- c(1,2,3,4,5)
    matrix: b <- matrix(data=c(1:20), nrow=4, ncol=5)
  • complex values: 1+1i