Re: How Mathematica do Interpolation?
- To: mathgroup at smc.vnet.net
- Subject: [mg14843] Re: How Mathematica do Interpolation?
- From: "Allan Hayes" <hay at haystack.demon.co.uk>
- Date: Fri, 20 Nov 1998 02:16:52 -0500
- References: <72jdo7$3ab@smc.vnet.net> <72tptr$ikv@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
P.J. Hinton in message <72tptr$ikv at smc.vnet.net>... gives two ways for loading the package Statistics`DescriptiveStatistics` when Mathematica starts Snip[] >Approach 1: > >1) Launch a Kernel and evaluate the following expression: > > ToFileName[{$PreferencesDirectory, "Kernel"}] > >This will print a path name that will be searched by the kernel as it >is loading. If there is an init.m file in this directory, it will be >loaded and evaluated by the kernel just like a package. While the path >given by $PreferencesDirectory may exist on your system, it is unlikely >that the Kernel directory does, so you'll need to create this manually. > >2) Open a text editor and type in the line: > >Needs["Statistics`DescriptiveStatistics"]; > >Save this file as a plain text document in the Kernel directory that you >created. Give the file the name "init.m". Close your text editor. > > >Approach 2: > >1) Evaluate the following expression in a kernel: > > ToFileName[{$PreferencesDirectory, "AddOns", "Autoload"}] > >This will print a path name that will be searched by the kernel as it >is loading. If there is subdirectory with path > > <parent context name>|Kernel| > >and there is a file named init.m in this directory, then the init.m >file will be loaded as well. These init.m files already reside in >standard package directories, so you don't need to do any text editing. >Whenever you invoke a function from your package, the package will be >loaded without any need to invoke the loading command. > >2) The path $PreferencesDirectory returned by evaluating $Preferences >directory probably already exists on your system, but you will need to >create the path AddOns|Autoload yourself. > >3) Once you have created this directory, copy the the folder > >ToFileName[{$TopDirectory, "AddOns", "StandardPackages", "Statisitics", >"Kernel"}] > >and its contents so that it sits in a directory with the name > >ToFileName[{$PreferencesDirectory, "AddOns, "Autoload", "Statistics"}] > >The next time you launch a kernel, the kernel will know to load the >Statistics`DescriptiveStatistics` package whenever you invoke a >function. > Paul I find that we can avoid using the $PreferencesDirectory with Approach 2 by creating a folder "Statistics" in ToFileName[{$TopDirectory, "AddOns, "Autoload"}] and then copying the folder ToFileName[{$TopDirectory, "AddOns", "StandardPackages", "Statistics","Kernel"}] to it. Is one position to be prefered to the other? Allan --------------------- Allan Hayes www.haystack.demon.co.uk hay at haystack.demon.co.uk Voice: +44 (0)116 271 4198 Fax: +44 (0)870 164 0565