13.07.2015 Views

Download pdf guide - VSN International

Download pdf guide - VSN International

Download pdf guide - VSN International

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3.2 Making lists more compact3.2 Making lists more compact 29The values of any data structure can be substituted into a list of the appropriate type,using the substitution symbol hash (#). So, for example, values of variates can besubstituted into number lists:VARIATE [VALUES=1,2,3,4] xVARIATE [VALUES=#x,#x] xxgives xx eight values (1,2,3,4,1,2,3,4).Similarly, values of texts can be substituted into lists of strings. For example, inTEXT [VALUES=data,errors] pdeREAD [PRINT=#pde] day,rainthe PRINT option of READ is given the setting data,errors.Lists of numbers that increase or decrease in a regular way can be representedconveniently in GenStat as progressions. These have the general formx, y ... zwhere x is the first number, y the second number, and z the final limit. You can put spacesanywhere within this construct except within the sequence of three dots (...). Theprogression generates a sequence of numbers:x, x + s, x + 2s as far as x + kswhere s is the difference between y and x (so x + s = y) and k is the largest integer suchthat x + ks does not go beyond z. The step can be either positive or negative and need notbe an integer. If the step is 1 or 1, the second number y can be omitted. For example1...5 = 1,2,3,4,55...12,4...10==5,4,3,2,12,4,6,8,102,(4...10) = 2,4,5,6,7,8,9,10Notice that the progression in the final example must be placed in brackets to make itclear that the second number has been omitted.Lists of numbers, strings, or identifiers that are repeated in a regular way can becompacted using multipliers.A pre-multiplier precedes a bracketed list and repeats the individual elements of thelist, in turn, a specified number of times. For example3(1,2) = 1,1,1,2,2,2Post-multipliers come after a bracketed list of numbers and repeat the entire list, enbloc, the specified number of times. For example(day,temp,rain)2 = day,temp,rain,day,temp,rainThey may be combined. For example2((1...3)2,4) = 1,1,2,2,3,3,1,1,2,2,3,3,4,4You can use scalars as pre-multipliers or post-multipliers but you must also use asubstitution symbolSCALAR [VALUE=3] nplotFACTOR [LEVELS=4; VALUES=#nplot(1),(2,3,4)#nplot] blockgives block the values1,1,1, 2,3,4, 2,3,4, 2,3,4

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!