
Create a Data Frame from Vectors in R
- R-PROGRAMMING
Use the data.frame() function in R to create a data frame from vectors.
The data frame in R is a two-dimensional array or table where each row contains the value of each column and the column contains the value for each variable. It can contain heterogeneous data. Vectors in R contain data of the same data type.
In this example, we will discuss how to create a data frame from vectors, add a new column vector to a data frame.