[Return
to tutorial page]
Statistics 200: Lab 11 (Friday 9 April 1998)
Today's tasks:
Setting up your own libraries, and dynamic graphics.
Libraries in Splus
When doing practical projects in Splus your working directory can get full
of many different objects and it can be difficult to keep organized. One
useful way of remaining organized is to set up a library (or libraries)
to store the important data and tools for the project. Creating your own
library is not a difficult task and it is definitely worthwhile when completing
a large project. Well here's how you do it.
Decide where you want to create the library (for this class use the A:
drive or the C:\user directory).
Decide on a name for your library (in Windows3.1 this name must be shorter
than 8 characters).
Your library may have sections to store different types of objects, decide
on a section name and create a directory with this name (the same constraints
on the name apply).
Within each section create a directory called _Data
and within this directory create a directory called _Help.
Run Splus with the working directory now being the library and section
_Data directory, (BM or JH will
demonstrate this). For example, if you have your library setup with the
_Data directory being A:\libraryname\sectionname\_Data,
then you need Splus to run with this as your working directory.
Use Splus, as you always do, to create your objects.
If you want to create a help file for any object type prompt(objectname),
this will create a template for your help file and you will need to edit
this later in a text editor (notepad for example). You may need
to copy these textiles into your _Data/_Help
directory. Creating help files can be useful if other people are going
to use your library. Help files can even help yourself when you return
to use the objects after a long time.
In your section directory create a file called README.TXT
that describes the library. In our example the file would be in the A:\libraryname\sectionname
directory.
In your library directory create a file called README.TXT
that describes the library and all the sections of the library. In our
example the file would be in the directory A:\libraryname.
If you need any inspiration, use filemanager to study the structure
of the Stat200 class library that is located in H:\classes\stat200.
Dynamic graphics
I will demonstrate a graphical program that gives a cartoon of a boat
sailing across the screen. You may notice that the sea level is going up
and down and the well designed boat just sails across the screen, going
up and down on the waves.
Think of a cartoon that you want to draw. The more complicated the better
(well we're not expecting a new episode of the Simpsons).
You will need to setup a graphics window. You will probably need to
mess with par. The best advise
we can give is check out the commands polygon,
and symbol. You may want to use
other commands of your own choice. Ask for help if there's something that
you can't seem to do. So good luck with expressing your artistic talents
in a whole new medium.