Next: data_files
Up: MacAnova Help File
Previous: cumstudrng()
Contents
Keywords:
control, general
Introduction
You can alter how MacAnova works either by using command line options
when launching MacAnova or by setting options once MacAnova has started.
You can automate these approaches by setting an environmental variable
MACANOVA and/or by preparing a startup file MacAnova.ini.txt.
One common reason doing this is to add additional search paths for
macros, help, and files. Also, on Unix/Linux, it may be necessary to
set the directory where MacAnova lives by using the -appdir option.
Environmental variable MACANOVA
MacAnova looks for an environmental variable MACANOVA. Its value should
be a list of command line options such as '-l 26 -w 75 -q' (see topic
'launching' for details on command line options). These are, in effect,
prepended to any command line options that you use and thus are can be
overridden by options on the command line. Some care may be needed
when quoting arguments with embedded spaces. Also, it may be necessary
to double any backslashes used in directory paths.
DOS/Windows example: add another search directory and set dumb plots to
be 26 lines and 75 columns. On Windows NT/2000/XP, right click on
"My Computer", then select "Properties", then select "Environment" (you
may need to select "Advanced" on some systems). Then add a new variable
MACANOVA with value -l 26 -w 75 -path c:\macanova\macros
On earlier systems you can add a line like the following in your
AUTOEXEC.BAT file.
SET MACANOVA=-l 26 -w 75 -path c:\macanova\macros
Unix/Linux example: set the application directory and add a directory to
the search path. The method for setting environment variables depends
on the shell that you use. For csh or a variant such as tcsh, add a line
similar to the following to the .chsrc file in your home directory:
setenv MACANOVA '-path ~/mymacros -appdir /usr/local/macanova'
For sh, bash, or ksh, add a line similar to the following to the .profile
file in your home directory:
MACANOVA='-path ~/mymacros -appdir /usr/local/macanova';export MACANOVA
Another use for MACANOVA is to make sure some standard macros are read
in or variables created by including '-e Command' in the environmental
variable (see 'launching'). For example, in Unix/Linux, one of
setenv MACANOVA "-e getmacros(ffplot,tsplot,spectrum,quiet:T)" [csh]
or
MACANOVA="-e getmacros(tsplot,ffplot,quiet:T)";export MACANOVA [sh]
ensures macros tsplot() and ffplot() will always be available. Warning:
The command cannot contain any spaces or tabs.
Customizing by using a startup file
When MacAnova is launched, it searches for a "startup" file with a
special name: MacAnova.ini.txt MacAnova searches in the default
directory and any directories listed in character vector DATAPATHS.
If it is found, MacAnova assumes the initialization file contains
MacAnova commands and executes it silently as a batch file before the
first prompt (see batch(), launching).
See topic 'launching' for information on how to specify an alternative
startup file using command line flag -f. See topic 'DATAPATHS' for a
description of setting the search path.
The use of a startup file is completely optional. If you have one, you
can put commands in it to set options such as the default output
formatting, file names to replace the default values of variables
DATAFILE, MACROFILES, DATAPATHS (see topic 'DATAPATHS'), and HOME (see
topic 'file_names') and the units (radians, degrees, or cycles) to be
used by trigonometric functions (see topic 'options'). You can also
include commands to create macros or read in macros that will thus
always be available whenever you launch MacAnova.
Note: setoptions(prompt:newprompt) has no effect in a startup file. See
topics setoptions(), 'options'.
The version of the startup file distributed with MacAnova does nothing
as it stands, since every action in it is in an if(F){...} clause. You
can activate actions in the file by editing it to change some or all of
the if(F){...} to if(T){...} using any text editor. If you use a word
processor, the file must be saved as a text or ASCII file.
Tektronix emulation
If you run a Unix/Linux version of MacAnova through a terminal emulating
program that can switch into and out of Tektronix 4014 emulation mode,
you may want to use a startup file that sets option 'tektest' to specify
the character strings that control such switches. See subtopic
'options:"tektest"'. This is not necessary when you are running in an
xterm window.
Example startup file
Here is a simple example of a possible MacAnova startup file (the line
numbers are for reference but are not part of the file)
Line #
1 setoptions(nsig:6,angles:"cycles",pvals:T,fstats:T,restoredel:F)
2 DATAFILE <- "timeser.dat"
3 addmacrofile("mytser.mac")
4 adddatapath("C:\\Time Series\\Data") #Windows form
5 ls <- macro("listbrief($0)")
6 if(isdefined(DEGPERRAD)){delete(DEGPERRAD,lockedok:T)}
If this were your startup file, it would have the following effects:
Line 1:
Output will be printed with 6 significant digits (option 'nsig')
Trigonometric functions will assume that angles are measured in cycles
with 1 equivalent to 2*pi (option 'angles')
Output from GLM functions such as anova(), regress(), and glmfit()
will include P values, and where appropriate, F-statistics (options
'pvals' and 'fstats')
Command restore() will not delete existing variables unless they are
overwritten or unless keyword phrase 'delete:T' is used on restore()
(option 'restoredel')
Line 2:
Pre-defined CHARACTER variable DATAFILE will be redefined to be
"timeser.dat". This will result in getdata() retrieving data
from file "timeser.dat".
Line 3:
Prepend "mytser.mac" to pre-defined CHARACTER vector MACROFILES,
ensuring that getmacros() will search file mytser.mac before the
standard macro files.
Line 4:
Prepend "C:\\Time Series\\Data" to predefined CHARACTER variable
DATAPATHS making it the first search directory. On Unix/Linux
might be something like "~/TimeSeries/Data", and on Mac OS 9
it might be "MyDisk:Time Series:Data". See topic 'DATAPATHS'.
Line 5:
Macro ls will be an "alias" for command listbrief()
Line 6:
Pre-defined REAL constant DEGPERRAD with value 180/pi will be deleted.
'lockedok:T' is required since DEGPERRAD is a locked variable.
Gary Oehlert
2006-01-30