خرید بک لینک

Vote count: 0

I am trying to aggregate an array based on the dimension name, in an efficient way.

ex_array <- array(1:10000, dim = c(100, 10, 10), dimnames = list(Col1 = c(rep(10,50), rep(20, 50)), Col2 = 1:10, Col3 = 1:10))

No I want to aggregate this array based on the names of the first dimension. This dimension has 2 different names (10 and 20) and therefore the new array should have a dimension of 2 by 10 by 10. All the values with dimension name 1 equal to 10 should be summed and the values with dimension 1 equal to 20 should be summed.

Is there some clever way of doing this?

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: دوشنبه 13 ارديبهشت 1395 ساعت: 15:43

صفحه بندی