[Rd] Depends, Suggests and .First.lib

From: Oscar Perpiñan Lamigueiro <oscar.perpinan_at_upm.es>
Date: Wed, 27 Jan 2010 11:01:55 +0100


Dear all,

I am working in the development of a package with more or less 25 functions. Most of them do not have dependencies on other extra packages. However, I am including three GUIs for the most important functions of the package. These three GUIs need the gWidgets package. Moreover, there is another function which makes use of latticeExtra and latticedl. Since these three packages are not needed for successfully load my package I understand, following the guidelines of "Writing R Extensions", that they do not need to be included under "Depends" but under "Suggests". But I am including the GUIs as a help for those people who are reluctant to the use of a console, so I would prefer these dependencies to be loaded automatically. Therefore I have written a zzz.R with this .First.lib function:

.First.lib <- function(lib, pkg){
 require(vcd, quietly = TRUE)
 if (!require(lattice, quietly = TRUE))    warning('lattice package could not be loaded. Some    funcionalities may not be available')  if (!require(latticedl, quietly = TRUE))   warning('latticedl package could not be loaded. Some   funcionalities may not be available')
 if (!require(latticeExtra, quietly = TRUE))   warning('latticeExtra package could not be loaded. Some   funcionalities may not be available')
 if (!(require(gWidgets, quietly = TRUE) &&

    (require(gWidgetstcltk, quietly = TRUE) || require(gWidgetsRGtk2, quietly = TRUE))))     warning('gWidgets package or their associated packages could not be loaded. GUI funcionalities will not be available') }
Perhaps it is better and easier to include these packages in "Depends" but I am not sure. I would appreciate your advice.

Another question is about the load of data. I am including two datasets which are used by two functions. They are small (about 6kB). Is it better to use LazyData:no or insert a data() inside the code of these two functions?

Thank you very much for your help.

Best regards.

Oscar Perpiñán Lamigueiro
Dpto. de Ingeniería Eléctrica
EUITI-UPM



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Wed 27 Jan 2010 - 10:04:31 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 27 Jan 2010 - 18:20:16 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive