R recycles if columns are not equal
num2 <- 1:10
alt2 <- cbind(patients, num2)
## Warning in cbind(patients, num2): number of rows of result is not a multiple of
## vector length (arg 1)
## patients num2
## [1,] "Bill" "1"
## [2,] "Gina" "2"
## [3,] "Kelly" "3"
## [4,] "Sean" "4"
## [5,] "Bill" "5"
## [6,] "Gina" "6"
## [7,] "Kelly" "7"
## [8,] "Sean" "8"
## [9,] "Bill" "9"
## [10,] "Gina" "10"
df <- data.frame(patients, my_matrix)
df
## patients X1 X2 X3 X4 X5
## 1 Bill 1 5 9 13 17
## 2 Gina 2 6 10 14 18
## 3 Kelly 3 7 11 15 19
## 4 Sean 4 8 12 16 20
## [1] "data.frame"