I am trying to merge two data frames of different lengths without using a unique key.
For example:
Name <- c("Steve","Peter")
Age <- c(10,20)
df1 <- data.frame(Name,Age)
> df1
Name Age
1 Steve 10
2 Peter 20
Name <-c("Jason","Nelson")
School <-c("xyz","abc")
df2 <- data.frame(Name,School)
> df2
Name School
1 Jason xyz
2 Nelson abc
I want to join these two tables so that I have all columns and have NA cells for rows that didn't have that column originally. It should look something like this:
Name Age School
1 Steve 10 <NA>
2 Peter 20 <NA>
3 Jason NA xyz
4 Nelson NA abc
thank you in advance!