R Basic | Variables, data type, matrix, list and vector in R/RStudio

Опубликовано: 09 Декабрь 2024
на канале: ZILANI GOLAM
198
10

in this video you will learn how to use and utilise variables, datatype, matrix, list and vector in r/rstudio.

A very common way of storing data is in a matrix, which is basically a two-way generalization of a vector. Instead of a single index, we can use two indexes, one representing a row and the second representing a column. The matrix function takes a vector and makes it into a matrix in a column-wise fashion.

A vector is the simplest type of data structure in R. The R manual defines a vector as “a single entity consisting of a collection of things.” A collection of numbers, for example, is a numeric vector — the first five integer numbers form a numeric vector of length 5.

Lists are the R objects which contain elements of different types like − numbers, strings, vectors and another list inside it. A list can also contain a matrix or a function as its elements. List is created using list() function.