next up previous contents index
Next: Deleting data Up: Using data Previous: Summarising data

Efficient usage of patterned data

 


tex2html_wrap_inline33790 tex2html_wrap_inline33790 Syntax

BD>factor : X=I tex2html_wrap_inline33794 ,I tex2html_wrap_inline33798 ,I tex2html_wrap_inline35146 tex2html_wrap_inline33712

where X is the name of an element or data-carrier, and tex2html_wrap_inline36716 are positive integers.

tex2html_wrap_inline33806 tex2html_wrap_inline33806

The FACTOR:  command allows the construction of patterned data efficiently so that it occupies very little memory. X is the name of either of an element or data-element, or will be created as a new data-element. If data already exists for this named quantity, it is deleted. The effect of the command is to create observations for the cases tex2html_wrap_inline36724 , and for this range of cases, to define the observation for the tex2html_wrap_inline34732 case as

displaymath36696

Thus the data vector consists of integers from tex2html_wrap_inline36726 , each integer being repeated consecutively I2 times in total; this process to continue until the specified length (I3) is reached. As an example, consider the following fragment of code:

BD>factor : X=3,2,7 tex2html_wrap_inline33712

This results in the creation or overwriting of a data-carrier X having the 7 observations:

displaymath36697

Data created in this way uses no conventional data storage - it is evaluated and retained in functional form. However, if at any time data that was defined via a FACTOR:  command becomes partly or wholly redefined, the efficient definition of the factor is deleted, and it is as though an entirely new data element is being defined.  



David Wooff
Wed Oct 21 15:14:31 BST 1998