<?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: JSL - Replacing Column Values with Vector in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JSL-Replacing-Column-Values-with-Vector/m-p/215077#M42998</link>
    <description>&lt;P&gt;Here is an old school way to do this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

//Example Table
dt = New Table ("Example",
	Add Rows ( 10 ),
	New Column ( "Test", &amp;lt;&amp;lt; Set Each Value ( 1 ) );
);

Wait (1); //Demonstration Purposes

x = [10, 10, 10];
start=3;
for(i=1,i&amp;lt;=nrows(x),i++,
	:test[i+start-1]=x[i]
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 27 Jun 2019 19:08:56 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2019-06-27T19:08:56Z</dc:date>
    <item>
      <title>JSL - Replacing Column Values with Vector</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Replacing-Column-Values-with-Vector/m-p/215064#M42996</link>
      <description>&lt;P&gt;I'm attempting to script a function that replaces a range of column values with a vector of equal dimension. My code below either rejects the argument entirely or just changes the entire cell value to the vector, rather than spanning the range. I can imagine creating a "for loop" that would iterate through each row and and index the vector accordingly, but writing one value at a time seems inefficient, especially since my actual spreadsheet has about 100k rows. Here is a simple example of my process:&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 );

//Example Table
dt = New Table( "Example", Add Rows( 10 ), New Column( "Test", &amp;lt;&amp;lt;Set Each Value( 1 ) ) );

Wait( 1 ); //Demonstration Purposes

x = [10, 10, 10];
:Test[3 :: 5] = x;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2019 15:15:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Replacing-Column-Values-with-Vector/m-p/215064#M42996</guid>
      <dc:creator>EDW</dc:creator>
      <dc:date>2019-06-28T15:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: JSL - Replacing Column Values with Vector</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Replacing-Column-Values-with-Vector/m-p/215077#M42998</link>
      <description>&lt;P&gt;Here is an old school way to do this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

//Example Table
dt = New Table ("Example",
	Add Rows ( 10 ),
	New Column ( "Test", &amp;lt;&amp;lt; Set Each Value ( 1 ) );
);

Wait (1); //Demonstration Purposes

x = [10, 10, 10];
start=3;
for(i=1,i&amp;lt;=nrows(x),i++,
	:test[i+start-1]=x[i]
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Jun 2019 19:08:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Replacing-Column-Values-with-Vector/m-p/215077#M42998</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-06-27T19:08:56Z</dc:date>
    </item>
  </channel>
</rss>

