From kasperdanielhansen at gmail.com  Sun Apr 24 16:17:36 2011
From: kasperdanielhansen at gmail.com (Kasper Daniel Hansen)
Date: Sun, 24 Apr 2011 10:17:36 -0400
Subject: [Rd] Loading a package
In-Reply-To: <954702.31628.qm@web29713.mail.ird.yahoo.com>
References: <4DB32D9F.5010406@aon.at>
	<954702.31628.qm@web29713.mail.ird.yahoo.com>
Message-ID: <BANLkTik-WhXGDy04PsT95XxmCochvvuySg@mail.gmail.com>

On Sun, Apr 24, 2011 at 10:08 AM, Orin Richards <oowar at yahoo.com> wrote:
>
>
> Hello All,
> I heard of the First() function in R. but am not sure entirely how it is used.
> ?I would like to load an R package at startup, instead of having to manually
> load each time I run R. How is the first() function used to achieve this .
>
> Specifically I would like to tell R at startup to look in a specific folder for
> the package and load it.
>
> Is there a way to do this, and is there any code sample code avail for this.

Orin

Is this for a package (in which case you solve it by using Depends) or
is it in general for your usage?  If the later, you can put code into
~/.Rprofile which is essentially an R script that gets run every time
you start R.  The code in the file would be something like
  library(PKGNAME, lib.loc = "DIR")

Kasper



[Rd] Loading a package
Kasper Daniel Hansen