Using the dplyr operation full_join(), I am trying to perform the equivalent of a basic operation merge()in which there are no common variables (it is impossible to satisfy the by by = argument). This will mix two data frames and return all possible combinations.
However, the current function full_join()requires a shared variable. I cannot find another dplyr function that can help with this. How to perform this operation using functions specific to the dplyr library?
df_a = data.frame(department=c(1,2,3,4))
df_b = data.frame(period=c(2014,2015,2016,2017))
big_df = merge(df_a,df_b)
big_df = dplyr::full_join(df_a,df_b)
source
share