Creating a personal library for R packages - Windoze 10.

  1. Create a directory called Rlibs. [The name is not that important but must match the name in the enironment variable later.
    Try to avoid network drives as this often results in performance issues if access to the network is slow.

    Here I created my personal packages directory C:\Rlibs.
    Other popular locations are under your Documents directory.

  2. Use the File Explorer to select Properties for your machine.

  3. Select Advanced System setting

  4. Select the Advanced tab; Select the Environment Variables option.

  5. Create a New Environment variable.

  6. Enter R_LIBS as the variable name. This MUST BE SPELLED EXACTLY as shown.
    Enter the location of your personal directory (from step 1).

  7. Press OK until all the dialogues are complete.

  8. Check that everything is working by launching Rstudio
    Type the following command in the console. You should see the new paths for your personal (package) library:

    Your personal library should be listed first.
    [ SFU Statistics and Actuarial Science Home | SFU Home]
    Email comments or suggestions to Carl Schwarz (cschwarz@stat.sfu.ca)
    © 2018 Carl James Schwarz Last updated 2018-10-15.