How to Create an Empty Matrix in R (Example Code)
In this R tutorial you’ll learn how to construct empty matrices.
Example: Create Empty Matrix in R
example_matrix <- matrix(ncol = 5, # Using matrix() function in R nrow = 0) example_matrix # Return empty matrix to RStudio console # [,1] [,2] [,3] [,4] [,5] |
example_matrix <- matrix(ncol = 5, # Using matrix() function in R nrow = 0) example_matrix # Return empty matrix to RStudio console # [,1] [,2] [,3] [,4] [,5]