Data structures in programming languages are used to store data in an organized manner. Data structures in R are similarly used to store data for different purposes. Basic data structures in R are ,

- Vectors
- Arrays
- Data frames
- Matrices
- Factors
- Lists

Let’s talk about each data structure briefly.

**1.Vectors**

Vectors are **one-dimensional **arrays. **c() **function is used to create a vector.

- nums <- c(1,2,3,4,6,-2,0,13) — — a numeric vector
- words <-c(“one”,”two”,”apple”) — — a character vector
- status <- c(TRUE,FALSE,TRUE,FALSE) — — a logical vector

*Scalars*

Scalars are** one element vectors** which means scalars hold constant values.

- num <- 9 —…