Installing R on a USB drive
Here are detailed instructions for installing and running R from a USB drive; these
instructions are not for installing R on a hard drive.
These instructions have been written for Windows XP systems as of January,
2009 with R version 2.8.1. Instructions also seem to work for Vista system,
but have been tested only when logged in as administrator. In Vista
the Windows XP "My Computer" became "Computer" on the Start Menu.
Step 1: Install R.
Step 2: Create a working directory on USB drive for user files.
- Go to: R project home page
- Click on CRAN (at left, under "Download").
- Select a CRAN mirror site.
- Under "Download and Install" Precompiled binary distributions ...
click on Windows.
- On the next page "R for Windows", click on base.
- On the next page download R-2.8.1-win32.exe Setup program (or the current version).
- Run the setup program.
- At the step "Select destination location" click Browse and navigate to the USB drive
to the location where R should be installed.
e.g. G:\R-2.8.1 if we are installing it
in the root directory of removable drive G.
- At the step "Select components" check all on-line PDF manuals
(recommended if you have space;
if space is limited, omit the reference manual.)
- "Startup options" click "Yes" for customized startup options.
- "Help style" choose the way you prefer to see help pages displayed. The familiar Windows style help is called CHM style.
- "Select Start Menu Folder" - check "Don't create a Start Menu folder"
- "Select Additional Tasks" - uncheck all tasks
(you will create a shortcut to R below.)
- Wait ... while the setup program installs all of the files.
Step 3: Create a shortcut to R (Rgui.exe) on USB drive.
- Open "My Computer" and navigate to the USB drive.
- File > New > Folder [or in Vista use Organize>New Folder].
- Give the working folder a name, say "Rfiles" (you choose the name).
- Open "My Computer" and navigate to the USB drive location where you would like the shortcut.
- In empty part of window right-click and select New>Shortcut.
- In "Create Shortcut" browse to Rgui (Rgui.exe) program. Rgui is located in
the bin subdirectory.
For example, if we
installed R in "G:\R-2.8.1" then we need to browse to or type
- Type a different name for this shortcut if you prefer. Click "Finish"
- Find the new shortcut, right click on it. Select "Properties".
- Under "Start in" enter the full path to the working directory created in Step 2.
An example is shown below.
After completing the steps above, in Windows XP
your USB drive might look similar to the following.
Step 4: Test installation by double clicking on USB shortcut to R.
In above picture you would double click on "Rgui.exe".
Step 5: Run "Update Packages" from the R "Packages" menu.
NOTE: You will not start R from the Start Menu in Windows.
Insert the USB drive into the computer and double click on the
shortcut that you created on the USB drive.