<?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 locate value and replace them in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/locate-value-and-replace-them/m-p/36224#M21292</link>
    <description>&lt;P&gt;Hi everybody,&lt;/P&gt;&lt;P&gt;I have this type of data table (see attached file). I want to detect all values which are outside of 2 threshold values (-0.5 and 0.5) and replace them by the ceiling values. For example: -5.30, -6.00, -11.56 must be replaced by the same value of -5.00, and 5.30, 6.00, and 11.56 replaced by 5.00.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have you any suggestion to do that in a simple way ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanking you in advance&lt;/P&gt;</description>
    <pubDate>Wed, 22 Feb 2017 15:15:42 GMT</pubDate>
    <dc:creator>paul_apicella</dc:creator>
    <dc:date>2017-02-22T15:15:42Z</dc:date>
    <item>
      <title>locate value and replace them</title>
      <link>https://community.jmp.com/t5/Discussions/locate-value-and-replace-them/m-p/36224#M21292</link>
      <description>&lt;P&gt;Hi everybody,&lt;/P&gt;&lt;P&gt;I have this type of data table (see attached file). I want to detect all values which are outside of 2 threshold values (-0.5 and 0.5) and replace them by the ceiling values. For example: -5.30, -6.00, -11.56 must be replaced by the same value of -5.00, and 5.30, 6.00, and 11.56 replaced by 5.00.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have you any suggestion to do that in a simple way ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanking you in advance&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2017 15:15:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/locate-value-and-replace-them/m-p/36224#M21292</guid>
      <dc:creator>paul_apicella</dc:creator>
      <dc:date>2017-02-22T15:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: locate value and replace them</title>
      <link>https://community.jmp.com/t5/Discussions/locate-value-and-replace-them/m-p/36267#M21319</link>
      <description>&lt;P&gt;If you think about doing this with JSL there are several ways.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, you could simply loop over the columns and conditionally replace cells&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Data Table("test.jmp");
For(i = 8, i &amp;lt;= N Col(dt), i++,
    ur = dt &amp;lt;&amp;lt; get rows where(Column(dt, i)[] &amp;gt; 0.5);
    lr = dt &amp;lt;&amp;lt; get rows where(Column(dt, i)[] &amp;lt; -0.5);
    Column(dt, i)[ur] = 5;
    Column(dt, i)[lr] = -5;
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;An alternative (JMP 13) is to&amp;nbsp;work with&amp;nbsp;data tables as matrices using subscripts. The syntax also supports assignment, i.e. replacement of cell values. Here's an example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Data Table("test.jmp");
t = 0.5;                  // Treshold value 
c = 5;                    // Ceiling value  
nr = N Row(dt);
nc = N Col(dt);

M = dt[1 :: nr, 8 :: nc];// Matrix with all cells from col 8 to end of table
U = M &amp;lt;= t;              // Below upper limit?
L = M &amp;gt;= -t;             // Above lower limit?
//Assign treshold values to data table
dt[1 :: nr, 8 :: nc] = M :* (U &amp;amp; L) + c * (!U - !L);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Feb 2017 08:28:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/locate-value-and-replace-them/m-p/36267#M21319</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2017-02-23T08:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: locate value and replace them</title>
      <link>https://community.jmp.com/t5/Discussions/locate-value-and-replace-them/m-p/36268#M21320</link>
      <description>&lt;P&gt;Thank you very much MS,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your first option works very well !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PA&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2017 09:10:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/locate-value-and-replace-them/m-p/36268#M21320</guid>
      <dc:creator>paul_apicella</dc:creator>
      <dc:date>2017-02-23T09:10:10Z</dc:date>
    </item>
  </channel>
</rss>

