From h.wickham at gmail.com  Thu Feb 22 23:51:48 2007
From: h.wickham at gmail.com (hadley wickham)
Date: Thu, 22 Feb 2007 16:51:48 -0600
Subject: [Rd] Writing a package in which files must be sourced in a specific
	order
Message-ID: <f8e6ff050702221451n17d13a35oaa5e9859ccdb7834@mail.gmail.com>

Dear all,

I have been using the proto package to create objects with mutable
state for my ggplot package.  This has been very successful so far,
but I have run into a problem when building/installing the package,
because the source files need to be loaded in a specific order so that
dependencies are initialised correctly.

I have named the files so that dependencies are loaded before they are
needed, so that

lapply(dir("~/documents/ggplot/ggplot/R", full.name=T), source)

runs without error, but when installing the package I get an error
than indicates that the files aren't being loaded in alphabetical
order:

Error in proto(Geom, { : object "Geom" not found
Error: unable to load R code in package 'ggplot'
Error: package/namespace load failed for 'ggplot'

Can anyone suggest how I could get around this?

Regards,

Hadley



[Rd] Writing a package in which files must be sourced in a specific order
hadley wickham