As an alternative, ncol is often more logical if you are dealing with datasets:
d <- seq(1,100)
matrix(d, ncol = 10) # Don't use byrow here or the data will be transposed.
You can also use ncol() to obtain the number of columns from some other dataframe. ncol = ncol(df_1)