matrix - Matrices in R Programming -


i new r programming , have few questions regarding matrices in r.

i have function returns matrix. want check if returned matrix empty or not. how check in r? if integer can check is.null(someinteger). how check same in case of matrices?

also, integer can initialized x <- null . if have want initialize matrix. initialize mat <- matrix() or there other way? mat can of size.

thankyou.

there question of meant "empty" here test if matrix m has 0 length:

length(m) == 0 

regarding initializing matrix initializes 0x0 matrix:

m <- matrix(, 0, 0) 

and initalizes 1x1 matrix containing na:

m <- matrix() 

and initializes nr nc matrix of na values:

m <- matrix(, nr, nc) 

not clear whether of these useful. may want describe trying accomplish. why need initialize @ all?


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -