<?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: Integer data type vs Number data type in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Integer-data-type-vs-Number-data-type/m-p/53622#M30312</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/10806"&gt;@pen51&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/6696"&gt;@uday_guntupalli&lt;/a&gt;&amp;nbsp;is correct that J() is exactly the right function for this.&amp;nbsp; To get at the reason JMP is yelling at you is that certain JMP functions don't like to take variable names are arguments.&amp;nbsp; If needed, you can solve these kinds of problems with an eval-parse-eval insert sequence like so:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;eval(parse(eval insert("newmat = [](^N Rows(a)^, 2)")));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Please use Uday's solution, but this tip may help you later when you encounter a similar situation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 21 Mar 2018 20:37:04 GMT</pubDate>
    <dc:creator>cwillden</dc:creator>
    <dc:date>2018-03-21T20:37:04Z</dc:date>
    <item>
      <title>Integer data type vs Number data type</title>
      <link>https://community.jmp.com/t5/Discussions/Integer-data-type-vs-Number-data-type/m-p/53613#M30305</link>
      <description>&lt;P&gt;I have a column matrix, called "a", with&amp;nbsp;x rows. I'm trying to create&amp;nbsp;a matrix filled with 1's that has the same number&amp;nbsp;x rows.&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I say&amp;nbsp;newmat = [](N Rows(a), 2), I get the error "Expected integer for number of rows" when trying to create the matrix.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Type(3), and any other integer argument, will return "Integer" but Type(N Rows(a)) returns "Number". I tried setting the x rows to a variable name and trying that, but I get the same error. Is there another way to do this? I haven't found a way to convert a Number type to an Integer type on the boards or in the documentation.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Mar 2018 20:00:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Integer-data-type-vs-Number-data-type/m-p/53613#M30305</guid>
      <dc:creator>pen51</dc:creator>
      <dc:date>2018-03-21T20:00:46Z</dc:date>
    </item>
    <item>
      <title>Re: Integer data type vs Number data type</title>
      <link>https://community.jmp.com/t5/Discussions/Integer-data-type-vs-Number-data-type/m-p/53618#M30309</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/10806"&gt;@pen51&lt;/a&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;a = Random Index(100,10); 

NewMat = J(N Rows(a),1,1);  // Use the J() to do this &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The above sample worked for me&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 447px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/10011i9306A7C861F8B911/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Mar 2018 20:25:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Integer-data-type-vs-Number-data-type/m-p/53618#M30309</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2018-03-21T20:25:04Z</dc:date>
    </item>
    <item>
      <title>Re: Integer data type vs Number data type</title>
      <link>https://community.jmp.com/t5/Discussions/Integer-data-type-vs-Number-data-type/m-p/53620#M30311</link>
      <description>&lt;P&gt;Here are a couple of ways to create the matrix you are looking for&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;clear symbols();
a=[1 ,2 ,3];

b=j(n rows(a),1,1)

// or
b=a;
b[1::n rows(a)]=1;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Mar 2018 20:32:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Integer-data-type-vs-Number-data-type/m-p/53620#M30311</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-03-21T20:32:49Z</dc:date>
    </item>
    <item>
      <title>Re: Integer data type vs Number data type</title>
      <link>https://community.jmp.com/t5/Discussions/Integer-data-type-vs-Number-data-type/m-p/53622#M30312</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/10806"&gt;@pen51&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/6696"&gt;@uday_guntupalli&lt;/a&gt;&amp;nbsp;is correct that J() is exactly the right function for this.&amp;nbsp; To get at the reason JMP is yelling at you is that certain JMP functions don't like to take variable names are arguments.&amp;nbsp; If needed, you can solve these kinds of problems with an eval-parse-eval insert sequence like so:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;eval(parse(eval insert("newmat = [](^N Rows(a)^, 2)")));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Please use Uday's solution, but this tip may help you later when you encounter a similar situation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Mar 2018 20:37:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Integer-data-type-vs-Number-data-type/m-p/53622#M30312</guid>
      <dc:creator>cwillden</dc:creator>
      <dc:date>2018-03-21T20:37:04Z</dc:date>
    </item>
  </channel>
</rss>

