next up previous contents
Next: Creating a data field Up: Basic operations for managing Previous: Getting the lenght of

Setting the contents of the data field

 

tabular521

The command sets values defined by indexes in a given data field. The values are given in index-value pairs. If a field does not exist, then the parameters <len> and <type> must be given. The type is determined by one of the strings "int", "float" or "string". Note that a strong conversion is used meaning that, if an integer is given for a string field, then the value is handled as a string, and the same holds for all the other data types.

Example: In the following examples, the range (min/max) is computed to the data frame "minmax". The first field includes the minimum and the second field the maximum values, while the index 0 of the frame "minmax" refers to the first field in the source data "boston" (criminality). Thus, the operation setdata forces the minimum value for `criminality' to 5 and the maximum value to 50.

NDA> load boston.dat
NDA> fldstat -d boston -dout minmax -min -max
NDA> ls -fr minmax
minmax.min
minmax.max
NDA> setdata -f minmax.min -v 0=5;
NDA> setdata -f minmax.max -v 0=50;
...



Erkki Hakkinen
Thu Sep 24 11:51:34 EET DST 1998