Next: stringplot() Up: MacAnova Help File Previous: stemleaf()   Contents

strconcat()

Usage:
strconcat(var1 [,var2,...,vark] [, KeyPhrases]), where var1, var2, ...
  are arbitrary variables
KeyPhrases can be compnames:Names, labels:Labels, notes:Notes and
  silent:T, where Names, Notes and Labels are CHARACTER scalars or
  vectors.  Arguments var1, ... can also be keyword phrases with keyword
  names other than 'compnames', 'labels', 'notes' and 'silent'.



Keywords: structures, combining variables
strconcat(a,b,c,...) creates a structure from variables or structures a,
b, c, ... .

strconcat() differs from structure() in that, when an argument is a
structure, its top level components become top level components of the
result, while a structure argument to structure() becomes a single
component of the result.  For example, suppose a and d are non-structure
variables.  Then the value of strconcat(a, structure(b,c),d) is a
structure with 4 components, a, b, c, and d, while the value of
structure(a, structure(b,c),d) is a structure with 3 components, the
second of which is itself a structure with 2 components.

The names of components derived from non-structure arguments are
determined similarly to the names of components of structures created by
structure(), except that when varj is a keyword phrase, the keyword name
is ignored when the argument is a structure.

You can attach a vector of labels to a structure Str, one element for
each top level component, by Str <- strconcat(Str, labels:CharVec),
where CharVec is either a CHARACTER scalar or a CHARACTER vector of
length ncomps(Str).  When the structure is printed, the labels are used
instead of the component names.  You remove labels by Str <-
strconcat(Str,labels:NULL).  See topic 'labels' for more information.

str <- strconcat(a,b,...,notes:Notes), where Notes is a CHARACTER scalar
or vector, attaches Notes to str.  See topic 'notes'

When there is just one nonkeyword argument and it is a structure, its
labels or notes, if any, are transferred to the output unless keywords
'labels' and/or 'notes' are arguments.

See structure() for information about keywords 'compnames', 'notes' and
'silent'.

Example: Build structure in a loop
  Cmd> nterms <- dim(SS)[1];f <- structure(SS[1]/DF[1])
  Cmd> for(i,2,nterms-1){f <- strconcat(f,SS[i]/DF[i]);;}
  Cmd> f <- strconcat(f/(SS[nterms]/DF[nterms]),\
        compnames:TERMNAMES[-nterms])
This produces a structure consisting of F-statistics with components
having the names of the terms.

See also topics 'structures', structure(), compnames(), changestr(),
'keywords'.


Gary Oehlert 2003-01-15