From wdunlap at tibco.com  Thu Oct 11 20:59:52 2012
From: wdunlap at tibco.com (William Dunlap)
Date: Thu, 11 Oct 2012 18:59:52 +0000
Subject: [Rd] simplify2array edge case
Message-ID: <E66794E69CFDE04D9A70842786030B933713B7@PA-MBX04.na.tibco.com>

Should simplify2array(higher=TRUE) treat 1 by 1 matrices differently than others?
I expected a 3-dimensional array from all of the following 3 examples, not just the last 2.

  > str(simplify2array(list(array(11,c(1,1)), array(21,c(1,1))), higher=TRUE))
   num [1:2] 11 21
  > str(simplify2array(list(array(11:13,c(3,1)), array(21:23,c(3,1))), higher=TRUE))
   int [1:3, 1, 1:2] 11 12 13 21 22 23
  > str(simplify2array(list(array(11:13,c(1,3)), array(21:23,c(1,3))), higher=TRUE))
   int [1, 1:3, 1:2] 11 12 13 21 22 23

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com



[Rd] simplify2array edge case
William Dunlap