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

Let’s talk about each data structure briefly.


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


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

  • num <- 9 —…

Shehana Iqbal

Computer Science and Engineering undergraduate

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store