Displaying 3 results from an estimated 3 matches for "dim_1".
Did you mean:
dim1
2005 Apr 29
2
Subarrays
...,4)
Subarrays can be obtained as follows:
> v[3,2,,2]
[1] 71 87 103 119
> v[3,,,2]
[,1] [,2] [,3] [,4]
[1,] 67 83 99 115
[2,] 71 87 103 119
[3,] 75 91 107 123
[4,] 79 95 111 127
In the general case this procedure is very tedious.
Given an array
A, dim(A)=(dim_1,dim_2,...,dim_d)
and two vectors
v1=(n_i1,...n_ik), v2=(int_1,...,int_k) ('marginals' and relevant
'interval numbers')
is there a smart way to obtain
A[,...,int_1,....,int_2,....,....,int_k,....]
?
Best wishes
Gunnar Hellmund
2014 Nov 24
0
Error "promise already under evaluation ..."
> The above question still stands, but otherwise, I overlooked the most
> obvious solution:
>
> dim_1 <- function(x) dim(x)
>
> Unit: nanoseconds
> expr min lq mean median uq max neval cld
> dim(x) 0 1 72.941 1 1 2696 1000 a
> base::dim(x) 11549 13474 15105.950 14245 15399 60824 1000 c
>...
2014 Nov 24
1
Error "promise already under evaluation ..." with function(x, dim=dim(x))
On Sat, Nov 15, 2014 at 1:47 AM, Duncan Murdoch
<murdoch.duncan at gmail.com> wrote:
>
> On 14/11/2014, 9:06 PM, Henrik Bengtsson wrote:
> > I've meant to ask the following for several years now. I understand why:
> >
> >> foo <- function(x, dim=dim) { dim }
> >> foo(1)
> > Error in foo(1) :
> > promise already under evaluation: