Re: [R] How to pack my stuff into a package (library, collection)?

2008-04-08 Thread Uwe Ligges


Tribo Laboy wrote:
 Thanks all for the help and suggestions. I am little by little finding
 my way. I have another question to the people who use the R packaging
 system. Say I have a function called myfun.R. Where am I supposed to
 write the help to that function? When I use promt(myfun) or
 package.skeleton(myfun) I get a skeleton of the .Rd file which
 contains both help and R source. 

The R source in the Rd file is there instead of an example, you should 
replace it.
Note that Rd stands for R documentation, it should not include code 
sources, just documentation sources.


 What do you do with the original .R
 source file then - do you delete it? I suppose it is not necessary

No, it must be there in the package sources, otherwise you won't have 
any functions in your package.

Uwe Ligges


 anymore and all changes to R source and help can be done
 simultaneously in the .Rd file. Then it can be used to generate all
 the help and R files to be run. But then .Rd files cannot be run
 directly from R, so each time a change is done to the source, it must
 be re-exported in an .R file and run. Please tell me if I am wrong. Do
 you keep R-souce and R-help in separate files while developing and
 then combine them in a single .Rd file when you're finished?
 
 Yours still confused,
 
 TL
 
 On Mon, Apr 7, 2008 at 3:13 PM, Tribo Laboy [EMAIL PROTECTED] wrote:
 Hello,

  I am new useR, I have written some functions, which I currently use by
  source-ing them from the files.
  That's OK, but when I my functions start counting in the tens and
  hundreds I'd be glad to be able to type
  help.search(my_obscure_fun) and get a sensible reply. I also want
  to be able to load them as a package at startup and not have to
  source each one individually. I read through the Writing R
  Extensions file, but I am overwhelmed with the vast amount of
  prescribed detail that Extension Authors must follow - directory
  structure, file structure, etc. Luckily, I found the prompt
  function, which helps in writing of help-files in the form of fill-in
   the blanks. But that's only for the help-files. Reading further, it
  gets even more complicated. The user is referred to the R
  Installation and Administration document, which says that:

  If you want to build R or add-on packages from source in Windows, you
  will need to collect, install and test an extensive set of tools.

  These seem to include among others Perl and compiler. But R is an
  interpreted and cross-platform language, I don't understand the need
  for additional platform specific tools just to call a user collection
  of R-files. Anyone knows of a smooth introduction to these topics?

  Rgards,
  TL

 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] How to pack my stuff into a package (library, collection)?

2008-04-08 Thread Duncan Murdoch
Yesterday I wrote:
 I took a look at this today.  You get an error message but the package 
 is still installed without the CHM compiler, so that's less urgent.

 I did add a menu entry to install a source package from a directory:

 Packages | Install source package from local folder...

 to the alpha version.  I don't guarantee this will survive testing:  it 
 gives a fairly ugly error message if you don't have Rtools installed.

   
It didn't survive.  We'll be looking at a more complete solution for 
2.8.0, but we're out of time for 2.7.0.

Duncan Murdoch

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] How to pack my stuff into a package (library, collection)?

2008-04-08 Thread Duncan Murdoch
On 08/04/2008 7:08 AM, Tribo Laboy wrote:
 Thanks all for the help and suggestions. I am little by little finding
 my way. I have another question to the people who use the R packaging
 system. Say I have a function called myfun.R. 

I guess you mean you have a source file myfun.R, containing a definition 
of a function myfun.  You would put this in the R subdirectory of the 
package.  (You could have a function named myfun.R, but it looks a 
little strange.)

Where am I supposed to
 write the help to that function? When I use promt(myfun) or
 package.skeleton(myfun) I get a skeleton of the .Rd file which
 contains both help and R source. What do you do with the original .R
 source file then - do you delete it? I suppose it is not necessary
 anymore and all changes to R source and help can be done
 simultaneously in the .Rd file.

No, definitely not.  The source is copied to the Rd file just to remind 
you of what the function looks like, so that you can write documentation 
that is correct.  By the time you're finished editing that file, you'll 
have actual working examples in the Examples section, not the function 
definition.  You'll put the .Rd file into the man subdirectory of the 
package; R uses the \alias{myfun} line at the top to find the connection 
to your myfun function.

There is a proposal on the Google Summer of Code page to mix 
documentation with definitions in the .R file, but so far we don't do that.

  Then it can be used to generate all
 the help and R files to be run. But then .Rd files cannot be run
 directly from R, so each time a change is done to the source, it must
 be re-exported in an .R file and run. Please tell me if I am wrong. Do
 you keep R-souce and R-help in separate files while developing and
 then combine them in a single .Rd file when you're finished?

No, they are separate from the beginning, and stay separate.

Duncan Murdoch

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] How to pack my stuff into a package (library, collection)?

2008-04-08 Thread Tribo Laboy
okey-dokey, one more problem resolved.
Keeping one documentation .Rd file for each R source file.
Thanks!

TL

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] How to pack my stuff into a package (library, collection)?

2008-04-07 Thread Tribo Laboy
Hello,

I am new useR, I have written some functions, which I currently use by
source-ing them from the files.
That's OK, but when I my functions start counting in the tens and
hundreds I'd be glad to be able to type
help.search(my_obscure_fun) and get a sensible reply. I also want
to be able to load them as a package at startup and not have to
source each one individually. I read through the Writing R
Extensions file, but I am overwhelmed with the vast amount of
prescribed detail that Extension Authors must follow - directory
structure, file structure, etc. Luckily, I found the prompt
function, which helps in writing of help-files in the form of fill-in
 the blanks. But that's only for the help-files. Reading further, it
gets even more complicated. The user is referred to the R
Installation and Administration document, which says that:

If you want to build R or add-on packages from source in Windows, you
will need to collect, install and test an extensive set of tools.

These seem to include among others Perl and compiler. But R is an
interpreted and cross-platform language, I don't understand the need
for additional platform specific tools just to call a user collection
of R-files. Anyone knows of a smooth introduction to these topics?

Rgards,
TL

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] How to pack my stuff into a package (library, collection)?

2008-04-07 Thread talepanda
Though R is indeed cross-platform language, how to build depends on the 
environment. This is case for most cross-platform software, library, 
etc. Basically cross-platform means cross-platform for users.
When you build packages, you are not user but developer.

Rtools will help you.
http://www.murdoch-sutherland.com/Rtools/

BTW, as you mentioned, I want a easy method to pack tiny R functions 
(without C code, no documentation) into a library. In this case we need 
no extra tool such as perl, tex, chm tools, etc, right?


 Hello,
 
 I am new useR, I have written some functions, which I currently use by
 source-ing them from the files.
 That's OK, but when I my functions start counting in the tens and
 hundreds I'd be glad to be able to type
 help.search(my_obscure_fun) and get a sensible reply. I also want
 to be able to load them as a package at startup and not have to
 source each one individually. I read through the Writing R
 Extensions file, but I am overwhelmed with the vast amount of
 prescribed detail that Extension Authors must follow - directory
 structure, file structure, etc. Luckily, I found the prompt
 function, which helps in writing of help-files in the form of fill-in
  the blanks. But that's only for the help-files. Reading further, it
 gets even more complicated. The user is referred to the R
 Installation and Administration document, which says that:
 
 If you want to build R or add-on packages from source in Windows, you
 will need to collect, install and test an extensive set of tools.
 
 These seem to include among others Perl and compiler. But R is an
 interpreted and cross-platform language, I don't understand the need
 for additional platform specific tools just to call a user collection
 of R-files. Anyone knows of a smooth introduction to these topics?
 
 Rgards,
 TL
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] How to pack my stuff into a package (library, collection)?

2008-04-07 Thread Simon Blomberg
On Mon, 2008-04-07 at 15:13 +0900, Tribo Laboy wrote:
 Hello,
 
 I am new useR, I have written some functions, which I currently use by
 source-ing them from the files.
 That's OK, but when I my functions start counting in the tens and
 hundreds I'd be glad to be able to type
 help.search(my_obscure_fun) and get a sensible reply. I also want
 to be able to load them as a package at startup and not have to
 source each one individually. I read through the Writing R
 Extensions file, but I am overwhelmed with the vast amount of
 prescribed detail that Extension Authors must follow - directory
 structure, file structure, etc. Luckily, I found the prompt
 function, which helps in writing of help-files in the form of fill-in
  the blanks. But that's only for the help-files. Reading further, it
 gets even more complicated. The user is referred to the R
 Installation and Administration document, which says that:
 
 If you want to build R or add-on packages from source in Windows, you
 will need to collect, install and test an extensive set of tools.
 
 These seem to include among others Perl and compiler. But R is an
 interpreted and cross-platform language, I don't understand the need
 for additional platform specific tools just to call a user collection
 of R-files. Anyone knows of a smooth introduction to these topics?
 

Have a look at ?package.skeleton. It should get you started. If you just
want to build packages with pure R (no shared libraries etc.), I think
you won't need the other tools.

Cheers,

Simon.

 Rgards,
 TL
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.
-- 
Simon Blomberg, BSc (Hons), PhD, MAppStat. 
Lecturer and Consultant Statistician 
Faculty of Biological and Chemical Sciences 
The University of Queensland 
St. Lucia Queensland 4072 
Australia
Room 320 Goddard Building (8)
T: +61 7 3365 2506
http://www.uq.edu.au/~uqsblomb
email: S.Blomberg1_at_uq.edu.au

Policies:
1.  I will NOT analyse your data for you.
2.  Your deadline is your problem.

The combination of some data and an aching desire for 
an answer does not ensure that a reasonable answer can 
be extracted from a given body of data. - John Tukey.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] How to pack my stuff into a package (library, collection)?

2008-04-07 Thread Hans W. Borchers
Tribo Laboy tribolaboy at gmail.com writes:
 [...]
 These seem to include among others Perl and compiler. But R is an
 interpreted and cross-platform language, I don't understand the need
 for additional platform specific tools just to call a user collection
 of R-files. Anyone knows of a smooth introduction to these topics?

There is a small 15-pages tutorial:

Making R Packages Under Windows: A Simple Guide by P. Rossi
http://faculty.chicagogsb.edu/peter.rossi/research/bayes%20book/bayesm/
   Making%20R%20Packages%20Under%20Windows.pdf

that might be helpful as a step-by-step instruction.

Hans Werner

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] How to pack my stuff into a package (library, collection)?

2008-04-07 Thread Tribo Laboy
Hi Simon,

I did the example given in package.skeleton

f - function(x,y) x+y
g - function(x,y) x-y
d - data.frame(a=1, b=2)
e - rnorm(1000)

package.skeleton(list=c(f,g,d,e), name=mypkg)


then tried:

library(mypkg)

Error in library(mypkg) : there is no package called 'mypkg'


After checking the directory structure, I found the package 'mypkg'
placed under 'bin' sub-directory. I moved it to 'library', where all
of the CRAN downloaded packages are and this is what I get:

 library(mypkg)
Error in library(mypkg) :
  'mypkg' is not a valid package -- installed  2.0.0?


What am I missing?

Regards,

TL


On Mon, Apr 7, 2008 at 3:49 PM, Simon Blomberg [EMAIL PROTECTED] wrote:

 On Mon, 2008-04-07 at 15:13 +0900, Tribo Laboy wrote:
   Hello,
  
   I am new useR, I have written some functions, which I currently use by
   source-ing them from the files.
   That's OK, but when I my functions start counting in the tens and
   hundreds I'd be glad to be able to type
   help.search(my_obscure_fun) and get a sensible reply. I also want
   to be able to load them as a package at startup and not have to
   source each one individually. I read through the Writing R
   Extensions file, but I am overwhelmed with the vast amount of
   prescribed detail that Extension Authors must follow - directory
   structure, file structure, etc. Luckily, I found the prompt
   function, which helps in writing of help-files in the form of fill-in
the blanks. But that's only for the help-files. Reading further, it
   gets even more complicated. The user is referred to the R
   Installation and Administration document, which says that:
  
   If you want to build R or add-on packages from source in Windows, you
   will need to collect, install and test an extensive set of tools.
  
   These seem to include among others Perl and compiler. But R is an
   interpreted and cross-platform language, I don't understand the need
   for additional platform specific tools just to call a user collection
   of R-files. Anyone knows of a smooth introduction to these topics?
  

  Have a look at ?package.skeleton. It should get you started. If you just
  want to build packages with pure R (no shared libraries etc.), I think
  you won't need the other tools.

  Cheers,

  Simon.


   Rgards,
   TL
  
   __
   R-help@r-project.org mailing list
   https://stat.ethz.ch/mailman/listinfo/r-help
   PLEASE do read the posting guide 
 http://www.R-project.org/posting-guide.html
   and provide commented, minimal, self-contained, reproducible code.
  --
  Simon Blomberg, BSc (Hons), PhD, MAppStat.
  Lecturer and Consultant Statistician
  Faculty of Biological and Chemical Sciences
  The University of Queensland
  St. Lucia Queensland 4072
  Australia
  Room 320 Goddard Building (8)
  T: +61 7 3365 2506
  http://www.uq.edu.au/~uqsblomb
  email: S.Blomberg1_at_uq.edu.au

  Policies:
  1.  I will NOT analyse your data for you.
  2.  Your deadline is your problem.

  The combination of some data and an aching desire for
  an answer does not ensure that a reasonable answer can
  be extracted from a given body of data. - John Tukey.



__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] How to pack my stuff into a package (library, collection)?

2008-04-07 Thread Duncan Murdoch
Tribo Laboy wrote:
 Hi Simon,

 I did the example given in package.skeleton

 f - function(x,y) x+y
 g - function(x,y) x-y
 d - data.frame(a=1, b=2)
 e - rnorm(1000)

 package.skeleton(list=c(f,g,d,e), name=mypkg)


 then tried:

 library(mypkg)

 Error in library(mypkg) : there is no package called 'mypkg'


 After checking the directory structure, I found the package 'mypkg'
 placed under 'bin' sub-directory. I moved it to 'library', where all
 of the CRAN downloaded packages are and this is what I get:

   
 library(mypkg)
 
 Error in library(mypkg) :
   'mypkg' is not a valid package -- installed  2.0.0?


 What am I missing?

   
You created the source code for a package, but it needs some work to 
install it.  On Windows that means installing the Rtools collection and 
running Rcmd INSTALL pkgdir from the Windows command line (what some 
people call the DOS box).

At some point I'm sure we'll include those tools with R, but it will 
more or less double the size of the download.  We've been reluctant when 
a lot of our users are on slow connections, and most won't need those tools.

Duncan Murdoch
 Regards,

 TL


 On Mon, Apr 7, 2008 at 3:49 PM, Simon Blomberg [EMAIL PROTECTED] wrote:
   
 On Mon, 2008-04-07 at 15:13 +0900, Tribo Laboy wrote:
   Hello,
  
   I am new useR, I have written some functions, which I currently use by
   source-ing them from the files.
   That's OK, but when I my functions start counting in the tens and
   hundreds I'd be glad to be able to type
   help.search(my_obscure_fun) and get a sensible reply. I also want
   to be able to load them as a package at startup and not have to
   source each one individually. I read through the Writing R
   Extensions file, but I am overwhelmed with the vast amount of
   prescribed detail that Extension Authors must follow - directory
   structure, file structure, etc. Luckily, I found the prompt
   function, which helps in writing of help-files in the form of fill-in
the blanks. But that's only for the help-files. Reading further, it
   gets even more complicated. The user is referred to the R
   Installation and Administration document, which says that:
  
   If you want to build R or add-on packages from source in Windows, you
   will need to collect, install and test an extensive set of tools.
  
   These seem to include among others Perl and compiler. But R is an
   interpreted and cross-platform language, I don't understand the need
   for additional platform specific tools just to call a user collection
   of R-files. Anyone knows of a smooth introduction to these topics?
  

  Have a look at ?package.skeleton. It should get you started. If you just
  want to build packages with pure R (no shared libraries etc.), I think
  you won't need the other tools.

  Cheers,

  Simon.


   Rgards,
   TL
  
   __
   R-help@r-project.org mailing list
   https://stat.ethz.ch/mailman/listinfo/r-help
   PLEASE do read the posting guide 
 http://www.R-project.org/posting-guide.html
   and provide commented, minimal, self-contained, reproducible code.
  --
  Simon Blomberg, BSc (Hons), PhD, MAppStat.
  Lecturer and Consultant Statistician
  Faculty of Biological and Chemical Sciences
  The University of Queensland
  St. Lucia Queensland 4072
  Australia
  Room 320 Goddard Building (8)
  T: +61 7 3365 2506
  http://www.uq.edu.au/~uqsblomb
  email: S.Blomberg1_at_uq.edu.au

  Policies:
  1.  I will NOT analyse your data for you.
  2.  Your deadline is your problem.

  The combination of some data and an aching desire for
  an answer does not ensure that a reasonable answer can
  be extracted from a given body of data. - John Tukey.


 

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] How to pack my stuff into a package (library, collection)?

2008-04-07 Thread Tribo Laboy
On Mon, Apr 7, 2008 at 8:02 PM, Duncan Murdoch [EMAIL PROTECTED] wrote:
 Tribo Laboy wrote:

  Hi Simon,
 
  I did the example given in package.skeleton
 
  f - function(x,y) x+y
  g - function(x,y) x-y
  d - data.frame(a=1, b=2)
  e - rnorm(1000)
 
  package.skeleton(list=c(f,g,d,e), name=mypkg)
 
 
  then tried:
 
  library(mypkg)
 
  Error in library(mypkg) : there is no package called 'mypkg'
 
 
  After checking the directory structure, I found the package 'mypkg'
  placed under 'bin' sub-directory. I moved it to 'library', where all
  of the CRAN downloaded packages are and this is what I get:
 
 
 
   library(mypkg)
  
  
  Error in library(mypkg) :
   'mypkg' is not a valid package -- installed  2.0.0?
 
 
  What am I missing?
 
 
 
  You created the source code for a package, but it needs some work to
 install it.  On Windows that means installing the Rtools collection and
 running Rcmd INSTALL pkgdir from the Windows command line (what some
 people call the DOS box).

  At some point I'm sure we'll include those tools with R, but it will more
 or less double the size of the download.  We've been reluctant when a lot of
 our users are on slow connections, and most won't need those tools.

  Duncan Murdoch




Hi Duncan,


Thanks for your reply. I checked the Rtools and the other relevant
tools. I will most probably install them, although unwillingly.
Unwillingly, because I like my current setup very much, which is a
portable installation of R. I run it on the 5 different machines that
I use and it is very easy to sync no mater where I install new or
updated packages. I will probably have to designate one of the
machines as a development machine and the others will be run-only, but
this is very similar to compiled languages. Is there any way to set
them up inside the main R directory structure, independent of the
operating system, variables, etc.?

Once again, it would be very helpful to clarify what is it that is
needed to run my R-files and what INSTALL does (I did ?INSTALL, but I
am none the wiser). As a user I can do without all the bells and
whistles of a HTML or chm-help and just some command line parsing of
the Rd help files is just fine. Obviously, I can run my functions when
sourced and I do not interface to FORTRAN or C, so I do not
understand what more is needed. Is it a namespace issue or just help
file compilation? Whatever it is, I suspect that this rigid INSTALL
and package build process is very helpful to enforce good quality
packages on CRAN with good quality documentation. But isn't it an
overkill for average Joe Programmer, who will never submit
'joes_weighted_mean' package to CRAN?

Anyway, if you'd have some piece of advice, I'd really appreciate it.

Regards,

TL

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] How to pack my stuff into a package (library, collection)?

2008-04-07 Thread Duncan Murdoch
On 4/7/2008 9:33 AM, Tribo Laboy wrote:
  ...
 Hi Duncan,
 
 
 Thanks for your reply. I checked the Rtools and the other relevant
 tools. I will most probably install them, although unwillingly.
 Unwillingly, because I like my current setup very much, which is a
 portable installation of R. I run it on the 5 different machines that
 I use and it is very easy to sync no mater where I install new or
 updated packages. I will probably have to designate one of the
 machines as a development machine and the others will be run-only, but
 this is very similar to compiled languages. Is there any way to set
 them up inside the main R directory structure, independent of the
 operating system, variables, etc.?

I don't think it will ever be possible to share installed packages 
across different platforms.  The issue is that the different operating 
systems have different requirements for an installed package.  For 
example, Unix-alikes have soft links and make use of them; Windows 
installs don't.  (Recent Windows versions have something similar, but 
they are so rarely used that I think it would be a bad idea to use 
them.)  There are also differences in what functions are available in R 
in the different platforms (e.g. there's no windows() graphics device 
except on Windows), and some packages may install different things 
depending on the target platform.

So to do what you want to do, I'd suggest setting up a mini-repository 
for source packages, and updating from there whenever necessary.

 Once again, it would be very helpful to clarify what is it that is
 needed to run my R-files and what INSTALL does (I did ?INSTALL, but I
 am none the wiser). 

I think the best thing to do is to look at the source code.  The 
documentation will necessarily be a little general and abstract; if you 
want to know exactly what it does, just look.

As a user I can do without all the bells and
 whistles of a HTML or chm-help and just some command line parsing of
 the Rd help files is just fine. 

I'm not sure what you mean by command line parsing of the help files, 
but you can certainly set things up to avoid CHM help, and that makes 
package installation easier on Windows.  I am inclined to make HTML help 
the default in 2.8.0, so that by default you won't need the CHM 
compiler:  but that won't be until the fall, and there may be objections 
to the change.

 Obviously, I can run my functions when
 sourced and I do not interface to FORTRAN or C, so I do not
 understand what more is needed. 

I agree that we should make it easier to install packages without 
compiled code, and I think if you look at the evolution of Rtools over 
the years, you'll see that we have.  We aren't done yet.

 Is it a namespace issue or just help
 file compilation? Whatever it is, I suspect that this rigid INSTALL
 and package build process is very helpful to enforce good quality
 packages on CRAN with good quality documentation. But isn't it an
 overkill for average Joe Programmer, who will never submit
 'joes_weighted_mean' package to CRAN?

I don't think so.  I think even Joe benefits from the QA support in R. 
But if he doesn't want to make use of it, he does have the option of 
just source'ing the code.

 Anyway, if you'd have some piece of advice, I'd really appreciate it.

Two pieces:

1.  Do install Rtools, but read the options carefully.  You can get a 
smaller install by leaving out some optional components.  It's still 
likely to be on the order of 50 MB installed, because we rely on Perl, 
and it's about 40 MB.  Now, 50 MB sounds like a lot (it's more than 
twice the size of the hard drive on my first PC), but it's just 2.5% of 
the size of the USB thumb drive in my pocket, and less than 0.02% of the 
size of the hard drive in the PC I just bought for my mother.  It's 
really trivial for most people.

2.  Study the install process, and identify ways in which we could make 
it easier for people in your circumstances without making it harder for 
everyone.  Let us know, and contribute documentation or patches that do 
it.

Duncan Murdoch

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] How to pack my stuff into a package (library, collection)?

2008-04-07 Thread Tribo Laboy
On Mon, Apr 7, 2008 at 11:09 PM, Duncan Murdoch [EMAIL PROTECTED] wrote:
 On 4/7/2008 9:33 AM, Tribo Laboy wrote:
   ...


  Hi Duncan,
 
 
  Thanks for your reply. I checked the Rtools and the other relevant
  tools. I will most probably install them, although unwillingly.
  Unwillingly, because I like my current setup very much, which is a
  portable installation of R. I run it on the 5 different machines that
  I use and it is very easy to sync no mater where I install new or
  updated packages. I will probably have to designate one of the
  machines as a development machine and the others will be run-only, but
  this is very similar to compiled languages. Is there any way to set
  them up inside the main R directory structure, independent of the
  operating system, variables, etc.?
 

  I don't think it will ever be possible to share installed packages across
 different platforms.  The issue is that the different operating systems have
 different requirements for an installed package.  For example, Unix-alikes
 have soft links and make use of them; Windows installs don't.  (Recent
 Windows versions have something similar, but they are so rarely used that I
 think it would be a bad idea to use them.)  There are also differences in
 what functions are available in R in the different platforms (e.g. there's
 no windows() graphics device except on Windows), and some packages may
 install different things depending on the target platform.

  So to do what you want to do, I'd suggest setting up a mini-repository for
 source packages, and updating from there whenever necessary.



  Once again, it would be very helpful to clarify what is it that is
  needed to run my R-files and what INSTALL does (I did ?INSTALL, but I
  am none the wiser).
 

  I think the best thing to do is to look at the source code.  The
 documentation will necessarily be a little general and abstract; if you want
 to know exactly what it does, just look.


  As a user I can do without all the bells and

  whistles of a HTML or chm-help and just some command line parsing of
  the Rd help files is just fine.
 

  I'm not sure what you mean by command line parsing of the help files, but
 you can certainly set things up to avoid CHM help, and that makes package
 installation easier on Windows.  I am inclined to make HTML help the default
 in 2.8.0, so that by default you won't need the CHM compiler:  but that
 won't be until the fall, and there may be objections to the change.



  Obviously, I can run my functions when
  sourced and I do not interface to FORTRAN or C, so I do not
  understand what more is needed.
 

  I agree that we should make it easier to install packages without compiled
 code, and I think if you look at the evolution of Rtools over the years,
 you'll see that we have.  We aren't done yet.



  Is it a namespace issue or just help
  file compilation? Whatever it is, I suspect that this rigid INSTALL
  and package build process is very helpful to enforce good quality
  packages on CRAN with good quality documentation. But isn't it an
  overkill for average Joe Programmer, who will never submit
  'joes_weighted_mean' package to CRAN?
 

  I don't think so.  I think even Joe benefits from the QA support in R. But
 if he doesn't want to make use of it, he does have the option of just
 source'ing the code.



  Anyway, if you'd have some piece of advice, I'd really appreciate it.
 

  Two pieces:

  1.  Do install Rtools, but read the options carefully.  You can get a
 smaller install by leaving out some optional components.  It's still likely
 to be on the order of 50 MB installed, because we rely on Perl, and it's
 about 40 MB.  Now, 50 MB sounds like a lot (it's more than twice the size of
 the hard drive on my first PC), but it's just 2.5% of the size of the USB
 thumb drive in my pocket, and less than 0.02% of the size of the hard drive
 in the PC I just bought for my mother.  It's really trivial for most people.

  2.  Study the install process, and identify ways in which we could make it
 easier for people in your circumstances without making it harder for
 everyone.  Let us know, and contribute documentation or patches that do it.

  Duncan Murdoch



Hi again,

Thanks for the advice. I do not mind the 40 MB or 50 MB. Still I'd
hope it would be possible to avoid it if full blown cross-platform
packages for CRAN are not needed. I am not a Perl hacker, but from
what I saw in the INSTALL source most of the calls that do the stuff
are to the system and zip utils, the other parts are Windows help-file
building (on Windows), housekeeping and checks, as far as I can tell.
For people in my situation (personal pure R packages), probably all
the checks if an older version exists or not are not so important, as
aren't the windows help-files. A command line parsing of the Rd files
will go a long way in reminding the programmer/user of how to use the
function. By command line parsing I mean typing 'help(fun)' and
getting inside