fnsd | R Documentation |
Given an array, returns the first non-singleton dimension. Useful for emulating some of Matlab / Octave's multidimensional functions.
If n
is supplied, return the first n
nonsingleton dimensions.
fnsd(a,n)
a |
An array |
n |
Integer. Return the first |
Returns an integer vector with elements in the range 1
to
length(dim(a))
.
Treats zero-extent dimensions as singletons.
Case n=0
now treated sensibly (returns a zero-length vector).
Robin K. S. Hankin
arev
a <- array(1:24,c(1,1,1,1,2,1,3,4)) fnsd(a) fnsd(a,2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.