...

/

Vectors and Matrices in R

Vectors and Matrices in R

Get introduced to vectors and matrices in R.

Understanding various types of objects in R

There are several different types of objects in R, and it’s crucial to understand how each of them works.

Some various types of data objects available in R

Objects

Modes

Several modes possible?

vector

numeric, character, logical, or complex

No

matrix

numeric, character, logical, or complex

No

data frame

numeric, character, logical, or complex

Yes

list

numeric, character, logical, complex, or another list

Yes

There are certainly more objects than these, but below are the foundational objects we need to understand for now. For each of these types of objects (and for most of anything in R), we can ask R what kind of object it is by using the str() function (short for “structure”). ...