SED navigation bar go to SED home page go to Dataplot home page go to NIST home page SED Home Page SED Staff SED Projects SED Products and Publications Search SED Pages
Dataplot Vol 2 Vol 1

CHARACTER CODE STRING

Name:
    CHARACTER CODE STRING (LET)
Type:
    Subcommand under LET
Purpose:
    Converts previously read character data to strings.
Description:
    Dataplot can now read character data using the

      SET CONVERT CHARACTER ON

    command. This command stores the character fields in the file "dpchzf.dat".

    The two primary uses of character data are:

    1. Provide a row identifier for the data.

    2. Define a group (or factor) variable. For example, we can identify sex by coding males as M and females as F.

    The command GROUP LABEL can be used to create a group label variable. However, in some contexts you may want more flexibility with the character data than provided by the GROUP LABEL command. The CHARACTER CODE STRING command can be used in this case to create explicit character strings.

    The CHARACTER CODE STRING command identifies the unique rows in the character variable (Dataplot checks for exact matches, it does not try to guess if a typo has occurred, etc.). If there are K unique rows, Dataplot will generate K character strings. The command defines a base name for the string and the appropriate index number will be appended to the string names.

    The CHARACTER CODE STRING extracts the index number for the string name in the order that the unique rows are encoutered in the file.

Syntax:
    LET <sbase> = CHARACTER CODE STRING <ix>
    where <ix> specifies the name of the character variable in the file dpzchf.dat;
    and      <sbase> specifies the base name for the strings to be generated.

    The character variable is originally created with a READ command where the SET CONVERT CHARACTER ON was entered prior to the READ.

Examples:
    SET CONVERT CHARACTER ON
    READ TEST.DAT Y X IX
    LET SLAB = CHARACTER CODE STRING IX
Default:
    None
Synonyms:
    None
Related Commands:
    READ = Carries out a column-wise input of data.
    CONVERT CHARACTER = Specify how Dataplot will handle character data.
    CHARACTER CODE = Convert previously read character data to a coded numerical variable.
    GROUP LABEL = Converts character data to a group label variable.
    GROUP LABEL TO STRINGS = Converts a previously created group label variable to strings.
    ROW LABELS = Define row labels from character data.
Applications:
    Input/Output
Implementation Date:
    2011/10
Program:
    set convert character on
    skip 25
    read draft69c.dat rank day month
    .
    .  Add cr() to alternating strings
    .
    let ig = character code string month
    let string cr = sp()cr()
    loop for k = 2 2 12
        let ig^k = string concatenate cr ig^k
    end of loop
    let ignew = group label ig1 to ig12
    x1tic mark label format group label
    x1tic mark label content ignew
    let xcode = character code month
    .
    major xtic mark number 12
    minor xtic mark number 0
    xlimits 1 12
    xtic offset 0.5 0.5
    .
    char box plot
    line box plot
    fences on
    .
    box plot rank xcode
        
    plot generated by sample program

Date created: 10/31/2011
Last updated: 10/31/2011
Please email comments on this WWW page to alan.heckert@nist.gov.