MENU

Fun & Interesting

bind_rows & bind_cols R Functions of dplyr Package (2 Examples) | Combine Data Frames & Vectors

Statistics Globe 7,793 5 years ago
Video Not Working? Fix It Now

How to combine columns and rows with the bind_rows and bind_cols functions of the dplyr package in the R programming language. More details: https://statisticsglobe.com/r-bind_rows-bind_cols-functions-dplyr-package R code of this video: data1 <- data.frame(x1 = 1:5, # Create three data frames x2 = letters[1:5]) data2 <- data.frame(x1 = 0, x3 = 5:9) data3 <- data.frame(x3 = 5:9, x4 = letters[5:9]) install.packages("dplyr") # Install dplyr package library("dplyr") # Load dplyr package bind_rows(data1, data2) # Apply bind_rows function bind_cols(data1, data3) # Apply bind_cols function Also, check out my video on the rbind function of Base R: https://www.youtube.com/watch?v=X1oz2a4F9Ys

Comment