powered by
x
size(x, k)
k
length(x)
Vector will be treated as a single row matrix.
dim
size(1:8) size(matrix(1:8, 2, 4)) # 2 4 size(matrix(1:8, 2, 4), 2) # 4 size(matrix(1:8, 2, 4), 3) # 1
Run the code above in your browser using DataLab