Re: [R] Problems creating packages.

From: Jay Emerson <>
Date: Sat 24 Jun 2006 - 23:54:23 EST

> I'm creating my own package for personal and I'm having trouble
> getting it to a point where R (v 2.3.1) will recognise it. I've
> followed two different tutorials for how to create the package
> structure and the DESCRIPTION file (
> ,
> . I'm still getting errors where when I try to load the library in R
> by using library(samp) I get an error:
> Error in library(samp) : 'samp' is not a valid package -- installed <

I'm going out on a limb, here, but others were quick to offer me advice and I didn't yet see
a reply to your query. I assume (from the links you provide and the use of sudo) that you
are working in Linux. Your R CMD check fails to find latex, which would be my first cause
for concern. Either you have an old or unusual linux system (unlikely) or there appears to
be a path problem (much more likely are probably related to using sudo). That is worth
tracking down, though it probably isn't the primary (or even the most R-specific) problem.

I don't think the problem is related to the contents of your files, per se, but rather the
organization of the files and folders in the source package. I had success starting with
package.skeleton() and working from there. The error about "only *source* packages
can be checked" is something I encountered once when I tried R CMD check on a
binary package rather than a source package (a binary package would be produced
by "R CMD build --binary packagename" once you get to that point), and a source package
is a beast of the form produced by package.skeleton().

I'm a newbie to making packages myself, and apologize for any inaccuracies or errors
above (and please correct me, folks)!



John W. Emerson (Jay)
Assistant Professor of Statistics
Yale University

	[[alternative HTML version deleted]]

______________________________________________ mailing list
PLEASE do read the posting guide!
Received on Sun Jun 25 00:03:23 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sun 25 Jun 2006 - 02:11:47 EST.

Mailing list information is available at Please read the posting guide before posting to the list.