[BlindRUG] Simple tip for automatic loading package

JooYoung Seo jooyoung at psu.edu
Thu Dec 3 19:20:25 UTC 2015


  Hi all,

  I am sharing simple tip you can use for loading any library or function
automatically when starting up R.

  Some of you might face errors if you just tried to add code lines into
.Rprofile (in your working directory) or /home/ect/Rprofile.site.

  Since all default packages should be loaded before your personalized
setting, you need to call .First.sys() function before desired libraries.

  The following example is what you might want to do to get R to
automatically load BrailleR package when starting the program:

 

#             # I will explain it for Window users, but other OS users also
can apply it.

 

##1. Launch Notepad and type the below:

 

.First.sys() # this is what you need for loading all needed default packages
before your script.

library(BrailleR) # loading BrailleR package

# You can add any other library or script as much as you want below.

 

##2. Save it to your working directory. Select "save as file type" as "all
files *". And filename must be ".Rprofile" without quotes.

 

  I hope it would be helpful.

  Thanks.

  Sincerely,

 

       JooYoung

 

       JooYoung Seo

--------------------

  Graduate Student,

  Learning, Design, and Technology

  Learning and Performance Systems

  The Pennsylvania State University

  Phone: +1 (814) 777-5836

  E-mail: jzs323 at psu.edu

 



---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nfbnet.org/pipermail/blindrug_nfbnet.org/attachments/20151203/b458fa20/attachment.html>


More information about the BlindRUG mailing list