QRMBook-workspace {QRMlib} | R Documentation |
Follow these instructions to build a QRMBook workspace in R where you can
run the book's scripts which build most of the graphics plots and tables in
the bookQuantitative Risk Management: Concepts, Techniques and Tools
by Alexander J. McNeil, Rudiger Frey and Paul Embrechts.
The QRMlib contains scripts which explain topics in most QRM Book chapters.
The folders containing the scripts are named something like
“C:\Program FilesRR-2.7.0\library\QRMlib\Chap2”, “...\Chap3”, etc.
You may open these scripts from within R by choosing File | Open Script from
the R-menu and then moving to the appropriate Chapter script for the QRM Book. Many
chapters contain multiple scripts.
Instructions to Build the QRMBook workspace
The following example assumes you are using R version R-2.7.0 in Windows.
If you are using a different version, substitute your version number in the
following instructions.
0. Be sure you have R closed.
1. Using MyComputer or Explorer test for the existence of the folder
C:\Program FilesRR-2.7.0\Users.
If ‘Users’ folder does NOT EXIST, create it.
Each separate project should be built in a subfolder of the ‘Users’ folder.
Next create a ‘QRMBook’ subfolder beneath the ‘Users’ subfolder.
You should now have a folder
C:\Program FilesRR-2.7.0\Users\QRMBook
which you will use only for running code from the QRMlib package.
2. Right-click the desktop and choose New | Shortcut from the menu.
3. Copy the following line (including quotation marks) into your clipboard:
“C:\Program FilesRR-2.7.0\binRgui.exe”
and paste the line into the box labeled “Type the location of the item”
4. Click the Next> button.
5. Type QRMBook (without any quotation marks) into the box labeled “Type
a name of this shortcut”. Then click the Finish button.
6. Find the shortcut you just created on your desktop. It will be
labeled “QRMBook”. Right-click the icon for the shortcut
and choose ‘Properties’.
7. The ‘Start in’ box says “C:\Program FilesRR-2.6.0\bin”. Modify it to read “C:\Program FilesRR-2.7.0\Users\QRMBook” (be sure to include the quotation marks). Then click OK.
You may now launch the QRMBook workspace by double-clicking the newly-created desktop icon.
This will open R with a workspace pointing to ‘...Users\QRMBook’.
However,there are still two problems with the workspace:
1. You want to avoid having to load the QRMlib each time you open the workspace.
See profileLoadLibrary
to resolve this issue
2. You want to use data without issuing the command data(filename) each time you open the workspace.
See storeDataInWorkspace
to resolve this issue.
profileLoadLibrary
storeDataInWorkspace