Combining different number of rows files

Hi,

Can anyone recommend hoe to combine files with different number of rows and columns? rbind and cbind don't work.

Thanks

1 Like

dplyr::bind_rows and dplyr::bind_cols, depending on how you want to do it. I like those functions much more than rbind and cbind. Give them a shot!

1 Like

Awesome. Thanks, dplyr should be installed as install.packages("dplyr") and the library imported as library(dplyr)?

1 Like

Once you install dplyr, you can use function in a qualified manner exactly as @cole demonstrated: dplyr::bind_rows and/or dplyr::bind_cols. In that case you don't need to add library(dplyr) to your script.
If you do add it, then you can use it without a qualifier (bind_rows/bind_cols), but I would say that first variant is better as it makes it abundantly clear where functions are coming from.

1 Like

Thank you for your response.