From retep.meissner at gmail.com  Fri Oct 20 21:33:18 2017
From: retep.meissner at gmail.com (Peter Meissner)
Date: Fri, 20 Oct 2017 21:33:18 +0200
Subject: [Rd] split() - unexpected sorting of results
Message-ID: <CAB-BFRp=_kmi5UaGESvzJzh6dxKz891LkFWY+nJ2uya=fQpZ7A@mail.gmail.com>

Hey,

I found this - for me - quite surprising and puzzling behaviour of split().


split(1:11, as.character(1:11))
split(1:11, 1:11)


When splitting by numerics everything works as expected - sorting of input
== sorting of output -- but when using a character vector everything gets
re-sorted alphabetical.


Although, there are some references in the help files to what happens when
using split, I did not find any note on this - for me - rather unexpected
behaviour.


I would like it best when the sorting of split results stays the same no
matter the input (sorting of input == sorting of output)

If that is not possibly a note of caution in the help pages and maybe an
example might be valuable.


Best, Peter

	[[alternative HTML version deleted]]



[Rd] split() - unexpected sorting of results
Peter Meissner