From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Thomas S. Dye" Subject: Re: Re: Org-mode Code Blocks Manuscript: Request For Comments Date: Tue, 7 Dec 2010 04:24:59 -1000 Message-ID: References: <87lj487z50.fsf@gmail.com> <20101203085837.499fc794@gaia.hsu-hh.de> <5F849514-EDEF-47A0-A059-0389DF230E4E@tsdye.com> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=56095 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PPyTZ-00007b-Ic for emacs-orgmode@gnu.org; Tue, 07 Dec 2010 09:25:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PPyTY-00084V-1E for emacs-orgmode@gnu.org; Tue, 07 Dec 2010 09:25:05 -0500 Received: from oproxy3-pub.bluehost.com ([69.89.21.8]:56360) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1PPyTX-00084K-L2 for emacs-orgmode@gnu.org; Tue, 07 Dec 2010 09:25:03 -0500 In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "Charles C. Berry" Cc: emacs-orgmode@gnu.org, Sunny Srivastava Aloha Chuck, On Dec 6, 2010, at 6:48 PM, Charles C. Berry wrote: > On Mon, 6 Dec 2010, Sunny Srivastava wrote: > >> Hello Chuck: >> >> Your idea is very interesting. I am curious to make use of your >> ideas. If it >> is not too much trouble, can you please share an example org file >> that you >> use for package development? I completely understand if you can't >> share the >> file. >> > > Sunny, > > I posted the vanilla version of the file at > > http://famprevmed.ucsd.edu/faculty/cberry/org-mode/RpkgExample.org > > It has the src blocks I use in each package. > > To use it, you set up a minimal package directory structure: > > myPackage/ > myPackage/DESCRIPTION > myPackage/man/ > myPackage/R/ > > say, and (optionally) put it under version control. > > Or use an existing package you are already working on. > > Or download one from CRAN, and untar it. > > Then copy RpkgExample.org to myPackage/ > > (or whatever the equivalent directory is) > > and you are ready to start. > > FWIW, if I have a good idea of what I am doing at the outset, I will > write functions in R/*.R files and create man/*.Rd files using > prompt() and then edit them, and then get around to checking, > installing, and trying out the package from the org file. > > But usually, I have only a fuzzy idea of what how to organize the > code, so I start by writing a snippet of code in an R :session src > block that sets up some objects of the sort I would want my package to > work on. I run that block. Then I might write a script in > another :session > src block to do some of the work I want the package to do, and > try it out. Once it works I wrap it into a function, and write another > :session src block to call the function. Once that works, I kill the > src block with the function in it and yank it into a fresh buffer > where it is saved as R/whatever.R. After using prompt() to make the > man/whatever.Rd and editting it, I am ready to run the package check, > install the package, restart my R session and load the package. Then I > can stitch together tests, examples, and more functions in the org > file, and test them and migrate them to the right places. > > > Comments welcome. > Thanks for sharing this. It looks useful. Would you consider putting it on Worg with the other babel source block examples? Have you thought about tangling the .R files directly from the Org- mode buffer? With :tangle R/whatever.R you might save yourself having to kill the source block, yanking it to a fresh buffer, and saving. My goal when designing these things, which might or might not appeal to you, is to hold the entire project in the Org-mode file. In the end, exporting the Org-mode file to html or pdf can yield a rich description of the project, independent of its product, man files, etc. Later, when I want to make changes, I know exactly where to go. All the best, Tom > Best, > > Chuck > > >> Your help is highly appreciated. >> >> Thank you in advance. >> >> Best Regards, >> S. >> >> On Mon, Dec 6, 2010 at 2:52 PM, Charles C. Berry > >wrote: >> >>> On Sat, 4 Dec 2010, Thomas S. Dye wrote: >>> >>> Aloha Detlef >>>> >>>> On Dec 2, 2010, at 9:58 PM, Detlef Steuer wrote: >>>> >>>> Hi! > > [rest deleted] > > > Charles C. Berry Dept of Family/ > Preventive Medicine > cberry@tajo.ucsd.edu UC San Diego > http://famprevmed.ucsd.edu/faculty/cberry/ La Jolla, San Diego > 92093-0901 > >