Skip to content

Instantly share code, notes, and snippets.

@orrymr
Last active September 13, 2021 18:17
Show Gist options
  • Save orrymr/7ad7e1a99cb2c72a60889f070f36a380 to your computer and use it in GitHub Desktop.
Save orrymr/7ad7e1a99cb2c72a60889f070f36a380 to your computer and use it in GitHub Desktop.
row1 <- c(2, 3, 4, 5, 6, 7) / 2
row2 <- c(3, 4, 5, 6, 7, 8) / 2
row3 <- c(4, 5, 6, 7, 8, 9) / 2
row4 <- c(5, 6, 7, 8, 9, 10) / 2
row5 <- c(6, 7, 8, 9, 10, 11) / 2
row6 <- c(7, 8, 9, 10, 11, 12) / 2
dice <- matrix(c(row1, row2, row3, row4, row5, row6), nrow = 6, byrow = TRUE)
dice
# [,1] [,2] [,3] [,4] [,5] [,6]
# [1,] 1.0 1.5 2.0 2.5 3.0 3.5
# [2,] 1.5 2.0 2.5 3.0 3.5 4.0
# [3,] 2.0 2.5 3.0 3.5 4.0 4.5
# [4,] 2.5 3.0 3.5 4.0 4.5 5.0
# [5,] 3.0 3.5 4.0 4.5 5.0 5.5
# [6,] 3.5 4.0 4.5 5.0 5.5 6.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment