To summarize and briefly explain the plenitude of examples given:

NB. Put scalars (rank 0) from newcol into vectors of table:
NB. "(0 1) -> scalars on left, vectors on right
  newcol 1}"0 1 table

NB. Put 1-column newcol into column of table.
  (,.newcol) (,1) }"1 table

NB. Put each element of newcol into (a: = wildcard = all rows),
NB. col 1 of table.
  newcol (<a:;1)} table



On 2/7/07, Chris Burke <[EMAIL PROTECTED]> wrote:

Sherlock, Ric wrote:
> Am new to J (from APL) and am having trouble with selective assignment .
> I understand that in J the equivalent is to use Amend.
> Given:
>    ]table=.4 2$ ;:'taa tas ewe wtw tweqewqwq 4212 fgsaera jihjy'
>    ]newcol=. ;:'mean to been formed'
>    ]newrow=. ;:'thra rowskd'
>
> Lets say I want to replace the 2nd column of table with a new column.
> The following works:
>    newcol (0 1;1 1;2 1;3 1)}table
>
> But this doesn't:
>    newcol 1}"1 table
> |rank error
> |   newcol     1}"1 table

Also:

   newcol (<a:;1)} table
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm




--
Devon McCormick
^me^ at acm.
org is my
preferred e-mail
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to