## Create numerical matrix
example_matrix <- matrix(1:16, ncol = 4, nrow = 4, byrow = TRUE)
## View
example_matrix
## Rasterise
rasterise_matrix(example_matrix)
## Create character matrix
example_matrix <- matrix(
c("A", "B", "C", "D", "E",
"F", "G", "H", "I", "J"),
nrow = 2, ncol = 5, byrow = TRUE
)
## View
example_matrix
## Rasterise
rasterise_matrix(example_matrix)
## Create realistic DNA matrix
dna_matrix <- matrix(
c(0, 0, 0, 0, 0, 0, 0, 0,
3, 3, 2, 3, 3, 2, 4, 4,
0, 0, 0, 0, 0, 0, 0, 0,
4, 1, 4, 1, 0, 0, 0, 0),
nrow = 4, ncol = 8, byrow = TRUE
)
## View
dna_matrix
## Rasterise
rasterise_matrix(dna_matrix)
Run the code above in your browser using DataLab