<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Sorting list of lists in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Sorting-list-of-lists/m-p/489474#M73260</link>
    <description>&lt;P&gt;You probably want the rank function. See &lt;LI-MESSAGE title="Sorting Lists" uid="240795" url="https://community.jmp.com/t5/JSL-Cookbook/Sorting-Lists/m-p/240795#U240795" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-tkb-thread lia-fa-icon lia-fa-tkb lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt; .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;list = {{"a", "b", "c", "d"}, {2, 3, 4, 1}};

r = rank(list[2]);
list[1] = list[1][r];
list[2] = list[2][r];

show(list);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;list = {{"d", "a", "b", "c"}, {1, 2, 3, 4}};&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;rank() returns a vector of indexes that retrieve the elements in order.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 21 May 2022 10:34:06 GMT</pubDate>
    <dc:creator>Craige_Hales</dc:creator>
    <dc:date>2022-05-21T10:34:06Z</dc:date>
    <item>
      <title>Sorting list of lists</title>
      <link>https://community.jmp.com/t5/Discussions/Sorting-list-of-lists/m-p/489413#M73257</link>
      <description>&lt;P&gt;JMP12&lt;/P&gt;&lt;P&gt;How to sort a list of lists by one list in the list of lists?&lt;/P&gt;&lt;P&gt;For example I want to sort by the numeric part of this list.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know I could iterate or make a table to sort this way, but is there a one-liner I don't know of? I feel like there must be an easier way to do it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;list = {{"a", "b", "c", "d"}, {2, 3, 4, 1}};&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;a,2&lt;/P&gt;&lt;P&gt;b,3&lt;/P&gt;&lt;P&gt;c,4&lt;/P&gt;&lt;P&gt;d,1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(list[1] and list[2] sorted by list[2])&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;{{"d", "a", "b", "c"}, {1, 2, 3, 4}};&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;d,1&lt;/P&gt;&lt;P&gt;a,2&lt;/P&gt;&lt;P&gt;b,3&lt;/P&gt;&lt;P&gt;c,4&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 16:59:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Sorting-list-of-lists/m-p/489413#M73257</guid>
      <dc:creator>ts2</dc:creator>
      <dc:date>2023-06-09T16:59:46Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting list of lists</title>
      <link>https://community.jmp.com/t5/Discussions/Sorting-list-of-lists/m-p/489474#M73260</link>
      <description>&lt;P&gt;You probably want the rank function. See &lt;LI-MESSAGE title="Sorting Lists" uid="240795" url="https://community.jmp.com/t5/JSL-Cookbook/Sorting-Lists/m-p/240795#U240795" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-tkb-thread lia-fa-icon lia-fa-tkb lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt; .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;list = {{"a", "b", "c", "d"}, {2, 3, 4, 1}};

r = rank(list[2]);
list[1] = list[1][r];
list[2] = list[2][r];

show(list);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;list = {{"d", "a", "b", "c"}, {1, 2, 3, 4}};&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;rank() returns a vector of indexes that retrieve the elements in order.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 21 May 2022 10:34:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Sorting-list-of-lists/m-p/489474#M73260</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2022-05-21T10:34:06Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting list of lists</title>
      <link>https://community.jmp.com/t5/Discussions/Sorting-list-of-lists/m-p/489496#M73262</link>
      <description>&lt;P&gt;Thanks this is exactly what I was looking for.&lt;/P&gt;</description>
      <pubDate>Sat, 21 May 2022 14:03:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Sorting-list-of-lists/m-p/489496#M73262</guid>
      <dc:creator>ts2</dc:creator>
      <dc:date>2022-05-21T14:03:23Z</dc:date>
    </item>
  </channel>
</rss>

