Next: getnotes() Up: MacAnova Help File Previous: getlabels()   Contents


getmacros(name1 [,name2 ... ] [,quiet:T, silent:T, printname:F]), name1,
  name2 ... quoted or unquoted macro names to be read from one of files
  named in CHARACTER vector MACROFILES

Keywords: macros, files, input
getmacros(Macro1,Macro2,...) retrieves macros Macro1, Macro2, ... from
one of the files whose names are in pre-defined CHARACTER vector
MACROFILES.  The macro names may be quoted (getmacros("mymacro")) or
unquoted (getmacros(mymacro)), but may not be CHARACTER variables.

By default, getmacros() prints the name of the file from each macro is

getmacros(Macro1,Macro2,...,quiet:T) retrieves the macros but suppresses
printing the descriptive comments associated with them.

getmacros(Macro1,Macro2,...,printname:F [,quiet:T]) does the same, but
the file name or names are not printed.

If there is more than one copy of any of the named macros in the files
named in MACROFILES, getmacros() retrieves the first one found.  The
files of macros are searched in the order they are in MACROFILES.

MACROFILES is predefined with value vector("graphics.mac","regress.mac",
"macanova.mac").  Each name in MACROFILES may also include a "path" with
directory or folder information.

You can easily add files to this list using pre-defined macro
addmacrofile() (see topic addmacrofile()) or replace it entirely by,
say, MACROFILES <- vector("mymacrofile1", "mymacrofile2").  If you often
use a particular macro file or files you might find it convenient to
have MACROFILES modified in your startup file.  See topic 'customize'.

Use of getmacros() is less necessary than it once was, since the default
behavior of MacAnova is now to search the files in MACROFILES for any
undefined macro you try to use.  For example, even if macro covar() has
not previously been read from file "MacAnova.mac", either by getmacros()
or macroread(),

  Cmd> cov <- covar(x)

will read covar() and then execute it.  However, is sometimes convenient
to use getmacros() to read in several macros at a time.  Moreover,
getmacros() echos the header lines on macros (unless you use quiet:T);
these often contain details about usage which you otherwise might miss.

Example:  If MACROFILES has its default value
  Cmd> getmacros(covar, spectrum, "confound3")
retrieves macros covar() from file "macanova.mac", spectrum() from
"tser.mac" and confound3() from "design.mac".  The quotes around
confound3() are not needed but do no harm.

Note: Prior to 4/28/96, getmacros() searched only the file specified in
CHARACTER scalar MACROFILE.  For backward compatibility, if vector
MACROFILES does not exist, getmacros() uses MACROFILE.  It is an error
if neither MACROFILES or MACROFILE exist.

Gary Oehlert 2003-01-15