Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I load a package without installing it in R?

Tags:

r

I have built an R package but I do not want my users to have to install it before using it.

Is there a way to load a package without having to install it?

For example, if I have a package mypackage.tar.gz, is there something like

library("mypackage.tar.gz")

?

like image 630
lindelof Avatar asked Mar 30 '11 10:03

lindelof


Video Answer


1 Answers

I'll join in "the chorus" of suggesting you should really install the package.

That having been said, you can take a look at Hadley's devtools package, which will let you load packages into the workspace without dumping in your global workspace.

The package will have to be untar'd/unzipped and follow the standard R package structure.

In order for this to work, though, your users would have to have the devtools package installed, so ... I'm not sure that this is any type of win for you.

like image 50
Steve Lianoglou Avatar answered Oct 12 '22 12:10

Steve Lianoglou