Last active
January 16, 2017 06:20
-
-
Save amirbehzad/bfb912c182a356ca367d19620024108c to your computer and use it in GitHub Desktop.
cbind.r
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
df1 <- createDataFrame(data.frame(a=c(1,2,3))) | |
df2 <- createDataFrame(data.frame(b=c(2,3,4))) | |
df1 = withColumn(df1, "index", monotonically_increasing_id()) | |
df2 = withColumn(df2, "index", monotonically_increasing_id()) | |
df_new = drop( | |
merge(df1, df2, by="index"), | |
c("index_x", "index_y")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment