Re: [Rd] The install.R and R_PROFILE.R files

2006-02-06 Thread Seth Falcon
On  5 Feb 2006, [EMAIL PROTECTED] wrote:
> I had a bumpy ride with this one.
>
> Ruuid/src/Makefile.win refers to src/include, which is not in a
> binary distribution so cannot be installed from an installed version
> of R 2.2.1. (That's a bug report.)

Thanks for the report, this has been fixed in the devel version of
Ruuid.

> graph throws an S4 signature error in R-devel.

Also fixed in devel, thanks.

> After fixing those, it works with LazyLoad on Windows but not in
> Unix where there is an error in the INSTALL script which I have now
> fixed.

Excellent, thanks.  

+ seth

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] The install.R and R_PROFILE.R files

2006-02-05 Thread Prof Brian Ripley
I had a bumpy ride with this one.

Ruuid/src/Makefile.win refers to src/include, which is not in a binary 
distribution so cannot be installed from an installed version of R 2.2.1. 
(That's a bug report.)

graph throws an S4 signature error in R-devel.

After fixing those, it works with LazyLoad on Windows but not in Unix 
where there is an error in the INSTALL script which I have now fixed.


On Thu, 2 Feb 2006, Seth Falcon wrote:

> Thanks for the explaination of LazyLoad, that's very helpful.
>
> On  1 Feb 2006, [EMAIL PROTECTED] wrote:
>> There is no intention to withdraw SaveImage: yes.  Rather, if
>> lazy-loading is not doing a complete job, we could see if it could
>> be improved.
>
> It seems to me that LazyLoad does something different with respect to
> packages listed in Depends and/or how it interacts with namespaces.
>
> I'm testing using the Bioconductor package graph and find that if I
> change SaveImage to LazyLoad I get the following:
>
>   ** preparing package for lazy loading
>   Error in makeClassRepresentation(Class, properties, superClasses, 
> prototype,  :
>   couldn't find function "getuuid"
>
> Looking at the NAMESPACE for the graph package, it looks like it is
> missing some imports.  I added lines:
>  import(Ruuid)
>  exportClasses(Ruuid)
>
> Aside: am I correct in my reading of the extension manual that if one
> uses S4 classes from another package with a namespace, one
> must import the classes and *also* export them?
>
> Now I see this:
>
>** preparing package for lazy loading
>Error in getClass("Ruuid") : "Ruuid" is not a defined class
>Error: unable to load R code in package 'graph'
>Execution halted
>
> But Ruuid _is_ defined and exported in the Ruuid package.
>
> Is there a known difference in how dependencies and imports are
> handled with LazyLoad as opposed to SaveImage?
>
> Thanks,
>
> + seth
>
>

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] The install.R and R_PROFILE.R files

2006-02-02 Thread Seth Falcon
Thanks for the explaination of LazyLoad, that's very helpful.

On  1 Feb 2006, [EMAIL PROTECTED] wrote:
> There is no intention to withdraw SaveImage: yes.  Rather, if
> lazy-loading is not doing a complete job, we could see if it could
> be improved.

It seems to me that LazyLoad does something different with respect to
packages listed in Depends and/or how it interacts with namespaces.

I'm testing using the Bioconductor package graph and find that if I
change SaveImage to LazyLoad I get the following:

   ** preparing package for lazy loading
   Error in makeClassRepresentation(Class, properties, superClasses, prototype, 
 : 
   couldn't find function "getuuid"  

Looking at the NAMESPACE for the graph package, it looks like it is
missing some imports.  I added lines:
  import(Ruuid)
  exportClasses(Ruuid)

Aside: am I correct in my reading of the extension manual that if one
uses S4 classes from another package with a namespace, one
must import the classes and *also* export them?

Now I see this:

** preparing package for lazy loading
Error in getClass("Ruuid") : "Ruuid" is not a defined class
Error: unable to load R code in package 'graph'
Execution halted   

But Ruuid _is_ defined and exported in the Ruuid package.

Is there a known difference in how dependencies and imports are
handled with LazyLoad as opposed to SaveImage?  

Thanks,

+ seth

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] The install.R and R_PROFILE.R files

2006-02-01 Thread Prof Brian Ripley
On Wed, 1 Feb 2006, Seth Falcon wrote:

> On  1 Feb 2006, [EMAIL PROTECTED] wrote:
>> Every usage of these on CRAN is unnecessary. If you want to save the
>> image, say so in the SaveImage field in DESCRIPTION (but why not
>> LazyLoad instead?).  If you require methods, say so in Depends in
>> DESCRIPTION.
>
> I've looked over the packages in the Bioconductor repository and I
> believe that every usage of R_PROFILE.R and install.R is also
> unnecessary.

Thanks for that.

>> (b) A package that requires a saved image (and lazy loading is
>> insufficient)?
>
> Many Bioc packages use SaveImage in their DESCRIPTION file.
>
> Could someone provide more detail on the difference between SaveImage
> and LazyLoad.  It is possible that LazyLoad would do just as well.

When an R package is installed, a file is prepared which is the 
concatenation of the (valid) files in the R directory.

With SaveImage, that file is loaded into an environment, and the 
environment dumped as a all.rda file.  The R code is then replaced by 
a loader whose sole job is to load the all.rda file.

With LazyLoad, the R file is loaded into an environment, and the objects 
in the environment are dumped individually into a simple database. The R 
code is then replaced by a loader whose sole job is to create an 
environment of promises to load the objects from the database.
(There is an article in R-news about lazy-loading.)

Lazy-loading is the norm for all but packages with very small amounts of R 
code.

I don't know when saving an image might be needed in preference to 
lazy-loading.  The differences in space (and hence time) when the package 
is used can be considerable, in favour of lazy-loading.  Since saving the 
objects in an environment and saving an environment are not quite the same 
thing there are potential differences.  (I have forgotten, if I ever knew, 
what happens with lazy-loading when you have an object whose environment 
is another namespace, for example.)

There have been packages ('aod' and 'gamlss' are two) which have both 
SaveImage and LazyLoad true. That works but is wasteful.

I just looked at the 12 non-Windows CRAN packages with SaveImage: yes and 
replaced this by LazyLoad: yes.  All passed R CMD check after the change. 
This included 'debug' and 'mvbutils' which had SaveImage: yes, LazyLoad: 
no which suggests the author thought otherwise.

There is no intention to withdraw SaveImage: yes.  Rather, if lazy-loading 
is not doing a complete job, we could see if it could be improved.


-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] The install.R and R_PROFILE.R files

2006-02-01 Thread Seth Falcon
On  1 Feb 2006, [EMAIL PROTECTED] wrote:
> Every usage of these on CRAN is unnecessary. If you want to save the
> image, say so in the SaveImage field in DESCRIPTION (but why not
> LazyLoad instead?).  If you require methods, say so in Depends in
> DESCRIPTION.

I've looked over the packages in the Bioconductor repository and I
believe that every usage of R_PROFILE.R and install.R is also
unnecessary.

> (b) A package that requires a saved image (and lazy loading is 
> insufficient)?

Many Bioc packages use SaveImage in their DESCRIPTION file.

Could someone provide more detail on the difference between SaveImage
and LazyLoad.  It is possible that LazyLoad would do just as well.

Thanks,

+ seth

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] The install.R and R_PROFILE.R files

2006-02-01 Thread Prof Brian Ripley
R-exts says

   Both install.R and R_PROFILE.R should be viewed as experimental; the
   mechanism to execute code before attaching or installing the package may
   change in the near future. With the other facilities available as from R
   2.0.0 they should be removed if possible.

Every usage of these on CRAN is unnecessary. If you want to save the 
image, say so in the SaveImage field in DESCRIPTION (but why not LazyLoad 
instead?).  If you require methods, say so in Depends in DESCRIPTION.

I propose that we deprecate/remove this mechanism (as it makes 
installation a lot convoluted than it needs to be).  Does any one know of

(a) A usage that requires one of these files to do something which cannot 
now be done more simply via fields in DESCRIPTION, or

(b) A package that requires a saved image (and lazy loading is 
insufficient)?

If so, please let us know.

I am also minded to deprecate/remove the following command-line flags to 
INSTALL

   -s, --save[=ARGS] save the package source as an image file, and
 arrange for this file to be loaded when the
 package is attached; if given, ARGS are passed
 to R when creating the save image
   --no-save do not save the package source as an image file
   --lazyuse lazy loading
   --no-lazy do not use lazy loading
   --lazy-data   use lazy loading for data
   --no-lazy-datado not use lazy loading for data (current default)

since these have been superseded by the DESCRIPTION fields (and Windows 
does not support --save=ARGS).

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel