<?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: How do I associate three different columns together using namespace? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-do-I-associate-three-different-columns-together-using/m-p/516805#M74327</link>
    <description>&lt;P&gt;Just make that variable the last line in the function, something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names default to here(1);

myfunction = function( {},
	dt = Open("$Sample_data/iris.jmp");

	NS = New Namespace();
	col = {};
	col[1] = column(dt, "Sepal Length");
	col[2] = column(dt, "Sepal Width");
	col[3] = column(dt, "Petal Width");

	// if you have JMP 16:
	coldata1 = transform each ({c}, col, c &amp;lt;&amp;lt; GetasMatrix());

	// JMP 15 and older:
	coldata2 = {};
	for(i=1, i&amp;lt;=n items(col), i++,
		coldata2[i] = col[i] &amp;lt;&amp;lt; GetasMatrix()
	);

	// Either way you get the same result:
	Show(coldata1 == coldata2);

	// Return the list of lists:
	coldata1
);

show(myfunction());&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 01 Jul 2022 16:21:14 GMT</pubDate>
    <dc:creator>ih</dc:creator>
    <dc:date>2022-07-01T16:21:14Z</dc:date>
    <item>
      <title>How do I associate three different columns together using namespace?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-associate-three-different-columns-together-using/m-p/516156#M74276</link>
      <description>&lt;P&gt;I have three columns of data that I want to associate each row with each other. I was looking at namespace since I have to return a list back to another file. (Assuming I can use one singular list of lists within it to select the rows of data). If this is not the best way to do it (as a result of being too messy or better ways to do it). How can this be achieved?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is what I have so far, the code only associates two columns together. I'm not sure on how to associate the third. Ideally I would like to associate group2 with group3.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;NS = New Namespace();

group1 = column("group1")&amp;lt;&amp;lt;GetAsMatrix();
group2 = column("group2")&amp;lt;&amp;lt;GetAsMatrix();
group3 = column("group3")&amp;lt;&amp;lt;GetAsMatrix();
		
NS:group2 = groups;
for(i=1, i&amp;lt;=N Items(group1), i++,
NS:(group2[i]) = group1[i];
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Jun 2023 17:03:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-associate-three-different-columns-together-using/m-p/516156#M74276</guid>
      <dc:creator>Andyon98</dc:creator>
      <dc:date>2023-06-09T17:03:02Z</dc:date>
    </item>
    <item>
      <title>Re: How do I associate three different columns together using namespace?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-associate-three-different-columns-together-using/m-p/516335#M74288</link>
      <description>&lt;P&gt;I don't think you need to use a namespace to accomplish this, maybe just building a list of lists will do what you want. Is this moving the right direction?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names default to here(1);

dt = Open("$Sample_data/iris.jmp");

NS = New Namespace();
col = {};
col[1] = column(dt, "Sepal Length");
col[2] = column(dt, "Sepal Width");
col[3] = column(dt, "Petal Width");

// if you have JMP 16:
coldata1 = transform each ({c}, col, c &amp;lt;&amp;lt; GetasMatrix());

// JMP 15 and older:
coldata2 = {};
for(i=1, i&amp;lt;=n items(col), i++,
	coldata2[i] = col[i] &amp;lt;&amp;lt; GetasMatrix()
);

// Either way you get the same result:
Show(coldata1 == coldata2);

// All data is in one object you can return to another script:
Show(coldata1);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 Jun 2022 18:07:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-associate-three-different-columns-together-using/m-p/516335#M74288</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2022-06-30T18:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: How do I associate three different columns together using namespace?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-associate-three-different-columns-together-using/m-p/516649#M74308</link>
      <description>&lt;P&gt;This works - thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2022 10:45:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-associate-three-different-columns-together-using/m-p/516649#M74308</guid>
      <dc:creator>Andyon98</dc:creator>
      <dc:date>2022-07-01T10:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: How do I associate three different columns together using namespace?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-associate-three-different-columns-together-using/m-p/516763#M74322</link>
      <description>&lt;P&gt;If this is in a function, how can I return the list? Im not familiar with the syntax on JSL.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2022 15:30:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-associate-three-different-columns-together-using/m-p/516763#M74322</guid>
      <dc:creator>Andyon98</dc:creator>
      <dc:date>2022-07-01T15:30:12Z</dc:date>
    </item>
    <item>
      <title>Re: How do I associate three different columns together using namespace?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-associate-three-different-columns-together-using/m-p/516805#M74327</link>
      <description>&lt;P&gt;Just make that variable the last line in the function, something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names default to here(1);

myfunction = function( {},
	dt = Open("$Sample_data/iris.jmp");

	NS = New Namespace();
	col = {};
	col[1] = column(dt, "Sepal Length");
	col[2] = column(dt, "Sepal Width");
	col[3] = column(dt, "Petal Width");

	// if you have JMP 16:
	coldata1 = transform each ({c}, col, c &amp;lt;&amp;lt; GetasMatrix());

	// JMP 15 and older:
	coldata2 = {};
	for(i=1, i&amp;lt;=n items(col), i++,
		coldata2[i] = col[i] &amp;lt;&amp;lt; GetasMatrix()
	);

	// Either way you get the same result:
	Show(coldata1 == coldata2);

	// Return the list of lists:
	coldata1
);

show(myfunction());&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Jul 2022 16:21:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-associate-three-different-columns-together-using/m-p/516805#M74327</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2022-07-01T16:21:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do I associate three different columns together using namespace?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-associate-three-different-columns-together-using/m-p/516808#M74328</link>
      <description>&lt;P&gt;thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2022 16:22:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-associate-three-different-columns-together-using/m-p/516808#M74328</guid>
      <dc:creator>Andyon98</dc:creator>
      <dc:date>2022-07-01T16:22:44Z</dc:date>
    </item>
  </channel>
</rss>

