Skip to content

Writing R packages in an easier way?

5 messages · S Ellison, Uwe Ligges, Michael Wolf +2 more

#
RTools and TeX?

Installing Rtools is not hard, and doesn't have to happen often; the
hardest bit in Windows is making sure that the requisite executables are
on the path, and that just involves adding the directory names to the
path environment variable. If I understand you, the problem is the time
spent hacking about in the .Rd help files. That can certainly be
simplified - eliminated, in fact.

Use package.skeleton() once you have a good starting set of functions
and data in R. That creates all the necessary directories, creates
skeleton (but valid) .Rd files, and exports your functions and data
objects for you. You can then edit the code directly, use RCMD check to
check the package (useful anyway) and use RCMD build to build it. (In
fact if all you want is the zip, you can - or at least could - zip the
package directory created by RCMD check). 

S Ellison


*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}
#
On 11.02.2011 13:38, S Ellison wrote:
Actually, just say

R CMD INSTALL --build  package

which will generate the zip in a supported way.

Uwe Ligges
#
Dear collegues,

thanks for your helpfull and persuasive comments. I see that all of you propose 
to work with the official method building R packages. The code of importing 
functions which Barry Rowlingson posted to the forum is very interesting and 
perhaps I can use this for solving other problems.
I'm thinking about a monitoring project with R in the center of my working. 
Therefore I need help files for describing my programming code.

In the consequence of this I have to accept that using the official R way of 
writing a package will be the best in the long run - even it will take some time 
to me especially to write the help files. SO I will reactivate my RTools and TeX!

Best regards

Dr. Michael Wolf
(m-wolf at muenster.de)


Am 11.02.2011 18:49, schrieb Uwe Ligges:
#
On Fri, Feb 11, 2011 at 7:38 AM, S Ellison <S.Ellison at lgc.co.uk> wrote:
Also you can avoid setting environment variables for R by grabbing
Rcmd.bat from http://batchfiles.googlecode.com and placing it anywhere
on your path -- note: entering the one word, path, from the Windows
cmd line shows you your path.

Rcmd.bat looks up R in the registry and then passes its arguments to
the real Rcmd.
#
Hi,

Another option is to go ahead and make the package structure you're
used to, but try to load and use it via Hadley's devtools package,
instead of installing it for use.

It might do the trick for you:

https://github.com/hadley/devtools

-steve
On Fri, Feb 11, 2011 at 2:14 PM, Dr. Michael Wolf <m-wolf at muenster.de> wrote: