I have a dataframe of dimensions[1] 1 11
and [1] 3 29
. I am trying to cbind these two dataframes such that dataframe having one row will be copied thrice to the resultant dataframe.
When I use cbind, it works sometimes but throws error as
Error in data.frame(..., check.names = FALSE) : arguments imply differing number of rows: 1, 3
> dim(a)
[1] 1 11
> dim (b)
[1] 3 29
> cbind(a,b)
Error in data.frame(..., check.names = FALSE) :
arguments imply differing number of rows: 1, 3
However if I try subsetting, it works.
> cbind(a[1:10],b) #Works Fine
> cbind(a[1:11],b) #Throws Error
Note: It works sometimes, but doesn't work if I run the code again.
Thanks