# NOT RUN {
X <- matrix2(letters[1:15], ncol = 3)
apply(X, 1, function(x) paste(x, collapse = "")) # simplifies to a vector
map_along_dim(X, 1, ~paste(.x, collapse = "")) # returns a list
identical(
map_along_rows(X, identity),
map_along_dim(X, 1, identity)) # TRUE
identical(
map_along_cols(X, identity),
map_along_dim(X, -1, identity)) # TRUE
# }
Run the code above in your browser using DataLab