How to combine two vectors in a data frame

807 views Asked by At

I am not able to combine two vectors like these

Height    Sex
178         M
167         M
183         M
...

Height    Sex
165         F
161         F
174         F
...

I would like to combine in a data frame like this

Height    Sex
178        M
161        M
174        M

Thanks

1

There are 1 answers

0
MBorg On

You should use dput() on your vectors so that we understand more about the code behind them. Currently your data looks like it is contained within two data frames each with two columns (height and sex), as opposed to two vectors.

If the data is indeed within two data frames, you can combine them using rbind() as per Alice's suggestion.