emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Rainer M Krug <Rainer@krugs.de>
To: schulte.eric@gmail.com
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>,
	Charles Berry <ccberry@ucsd.edu>
Subject: Re: [babel][PATCHES] ob-R patches for review
Date: Fri, 09 May 2014 14:02:58 +0200	[thread overview]
Message-ID: <m24n0zw45p.fsf@krugs.de> (raw)
In-Reply-To: <m2k39vwc3f.fsf@krugs.de> (Rainer M. Krug's message of "Fri, 09 May 2014 11:11:32 +0200")

[-- Attachment #1: Type: text/plain, Size: 4764 bytes --]

Rainer M Krug <Rainer@krugs.de> writes:

> Rainer M Krug <r.m.krug@gmail.com> writes:
>
>> Envoyé de mon iPhone
>>
>>> Le 8 mai 2014 à 04:26, Charles Berry <ccberry@ucsd.edu> a écrit :
>>> 
>>> Eric Schulte <schulte.eric <at> gmail.com> writes:
>>> 
>>>> 
>>>> Rainer M Krug <Rainer <at> krugs.de> writes:
>>>> 
>>>>> Hi
>>>>> 
>>>>> Attached please find seven patches for review to implement the storing
>>>>> of org variables in their own environment and to make the org-issued R
>>>>> code look nicer in the R session.
>>>>> 
>>>>> Thanks,
>>>>> 
>>>>> Rainer
>>>> 
>>>> Hi Rainer,
>>>> 
>>>> Thanks for these patches.  I don't have the R experience to review or
>>>> maintain them, but I'm happy to apply them.
>>>> 
>>>> I missed some previous discussion in this thread.  Are these patches
>>>> ready to be applied as is?
>>> 
>>> 
>>> IMO, the patches hard coded behaviors that would better be customizable
>>> and optional. 
>>
>> I'll give feedback tomorrow and let you know about customization of
>> the name of the environment. The general behavior of storing the
>> variables in an environment should not be customizable as it is
>>
>> 1) safer then the behavior of storing each variable separately
>> 2) no changes for the user are introduced 
>
> OK. Concerning customization options:
>
> There are a few points where customizations could be introduced:
>
> 1) transfer of variables from org to R, i.e. old behavior (variables in
> .GlobalEnv) or new behavior (in own environment (.org_variables_)) or
> own defined function
>
> 2) name of new environment
>
> 3) name of file into which to save the  variables (org_variables.RData)
>
> Some comments to each:
>
> 1) As outlined above, I see neither changes in behavior for the user
> nor disadvantages of the new behavior. As only one object is created in
> R (.org_variables_) instead of one for each variable, the chances of
> name clashes are much smaller. As the name of the variable starts with a
> dot (.), ends with an underscore (_), it is very unlikely that there is
> a nameclash in existing scripts (but you are right, one does not know).
> So I don't think, that it is necessary to include an option for
> disabling the old behavior. 
>
> Concerning defining an own function for data transfer, I am thinking of
> putting the variable transfer into an R function which can then be
> customized from R. My reasoning is that users using this feature are
> more likely to be fluent in R then in lisp, so more able to change these
> functions in R. In org, the whole R code would then simply replaced with
> one function call. These functions would reside in a new environment (or
> in the ESSR environment as offered by Vitalie).
>
> In addition, as it was not asked before to have this function
> customizable, I don't think there would be a large need for it.
>
> 2) I don't think name clashes are likely, so I don't see a real need to
> have the name of the org environment in R configurable. Especially when
> using these variables in R, one can always use
> .org_variables_::VARIABLENAME to access the original value. If the
> environment name is customizable, this will be different between
> customizations and not that easily reproducible between
> org-installations.
>
> It would be easy to configure it, but I think it is rather a
> disadvantage and would make the code (slightly) more complex.
>
> 3) The name into which the variables are saved could be configurable,
> but again, I do not think this is such an issue. The saved environment
> is anyway only of limited usage when the variables in org are not
> defined file wide but per source block / tree. I am actually thinking of
> removing this saving, although it is quite useful to make tangled code
> usable on a non-org system when org variables are used - comments?
>
> So please let me know if you see the need of customization and for
> which aspect.

I started looking into ESS in more detail and I got some useful ideas. 

I am including them at the moment in org, so please do not yet apply the
patches.

Cheers,

Rainer

>
>>
>> Cheers
>>
>> Rainer
>>
>>> 
>>> Rainer and I had some back and forth about this -- see the thread.
>>> 
>>> Best,
>>> 
>>> Chuck
>>> 
>>> 
>>> 

-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax :       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      Rainer@krugs.de

Skype:      RMkrug

PGP: 0x0F52F982

[-- Attachment #2: Type: application/pgp-signature, Size: 494 bytes --]

  reply	other threads:[~2014-05-09 12:03 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-29 12:43 [babel][PATCHES] ob-R patches for review Rainer M Krug
2014-04-29 18:15 ` Charles Berry
2014-04-30 12:28   ` Rainer M Krug
2014-04-30 22:49     ` Charles C. Berry
2014-05-01  9:10       ` Rainer M Krug
2014-05-07 10:27 ` Eric Schulte
2014-05-08  2:26   ` Charles Berry
2014-05-08 10:02     ` Rainer M Krug
2014-05-09  9:11       ` Rainer M Krug
2014-05-09 12:02         ` Rainer M Krug [this message]
2014-05-08  9:57   ` Rainer M Krug
2014-05-09 13:03     ` Bastien
2014-05-09 13:45       ` Rainer M Krug
2014-05-09 14:34         ` Eric Schulte
2014-05-12  8:33           ` Rainer M Krug
2014-05-12 12:23             ` Suvayu Ali
2014-05-12 12:41               ` Rainer M Krug
2014-05-12 14:01             ` Queestion concerning lists - was: " Rainer M Krug
2014-05-12 15:23               ` Eric Schulte
2014-05-12 15:21             ` Eric Schulte
2014-05-12 19:08               ` Rainer M Krug
2014-05-12 22:05                 ` Charles C. Berry
     [not found]                   ` <m2y4y2f499.fsf@krugs.de>
2014-05-16 18:22                     ` Charles C. Berry
2014-06-06 16:11                 ` Eric Schulte

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m24n0zw45p.fsf@krugs.de \
    --to=rainer@krugs.de \
    --cc=ccberry@ucsd.edu \
    --cc=emacs-orgmode@gnu.org \
    --cc=schulte.eric@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).