Returns a pipe-separated list of all row indices by category, to a worksheet column.
stringArray Catrows(vd,[option])$
vd
option
Returns a pipe-separated listing of all row indices by category of a categorical column vd.
EX1
//fill col(A) with "q w q w q", and set as categorical col(B)=Catrows(col(A))$; //1|3|5 //rows of q //2|4 //rows of w
EX2
// create an empty book newbook; // import the file automobile.dat into the new book impASC fname:="C:\Program Files\OriginLab\Origin2020b\Samples\Statistics\automobile.dat"; // set column 2 as categorical and sort it in ascending order wks.col2.categorical.type=2; wks.col2.categorical.sort=1; // get column 2 into range variable rA range rA = [automobile]automobile!"Make"; // create a new book and use category function to copy categories in rA to column A of newbook // to column B, add row indices of occurrence for each category, as a pipe-separated list // increase column width for visibility newbook; col(A)=category(rA)$; col(B)=catrows(rA)$; wks.col2.Width=50;