From pdalgd at gmail.com  Fri Jun 16 18:31:47 2017
From: pdalgd at gmail.com (peter dalgaard)
Date: Fri, 16 Jun 2017 18:31:47 +0200
Subject: [Rd] 'ordered' destroyed to 'factor'
In-Reply-To: <30D28A63376088428E8318DD67FD407F78BCE6@ny-mailstore1.walleyetrading.net>
References: <trinity-35849798-65be-4033-aa6e-d006a5defe16-1497618225192@3capp-webde-bs21>
 <30D28A63376088428E8318DD67FD407F78BCE6@ny-mailstore1.walleyetrading.net>
Message-ID: <77AA9D07-5621-44CC-8A72-D41F98186AB6@gmail.com>


> On 16 Jun 2017, at 15:59 , Robert McGehee <rmcgehee at walleyetrading.net> wrote:
> 
> For instance, what would you expect to get from unlist() if each element of the list had different levels, or were both ordered, but in a different way, or if some elements of the list were factors and others were ordered factors?
>> unlist(list(ordered(c("a","b")), ordered(c("b","a"))))
> [1] ?

Those actually have the same levels in the same order: a < b

Possibly, this brings the point home more clearly

unlist(list(ordered(c("a","c")), ordered(c("b","d"))))

(Notice that alphabetical order is largely irrelevant, so all of these level orderings are equally possible:

a < c < b < d
a < b < c < d
a < b < d < c
b < a < c < d
b < a < d < c
b < d < a < c

).

-pd
-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



[Rd] 'ordered' destroyed to 'factor'
peter dalgaard