How to create a new data frame from two existing vectors.

https://rstudio.cloud/project/2138069

I don't see any example in the link provided. if I login I see

image

Welcome to the community @GloryGlow! Below is a general example of creating a data frame from two vectors. Happy New Year!

vector1 = c('a', 'b', 'c')
vector2 = c(1, 2, 3)

df = data.frame(column1 = vector1,
                column2 = vector2)

df
#>   column1 column2
#> 1       a       1
#> 2       b       2
#> 3       c       3

Created on 2023-01-02 with reprex v2.0.2.9000

2 Likes

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.