VOOZH about

URL: https://www.geeksforgeeks.org/r-language/how-to-create-a-dataframe-from-given-vectors-in-r/

⇱ How to create a DataFrame from given vectors in R ? - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

How to create a DataFrame from given vectors in R ?

Last Updated : 23 Jul, 2025

In this article we will see how to create a Dataframe from four given vectors in R. To create a data frame in R using the vector, we must first have a series of vectors containing data. The data.frame() function is used to create a data frame from vector in R.

Syntax:

data.frame(vectors)

Example 1. Creating dataframe from given 4 vectors.

Output:

👁 Image

Example 2:

Output:

👁 Image

Comment

Explore