"Charles C. Berry" writes: > On Wed, 30 Apr 2014, Rainer M Krug wrote: > >> Charles Berry writes: >> >>> Rainer M Krug 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. >>> >>> >>> Rainer, >>> >>> >>> I have suggestions and a concern. >>> >>> I suggest [...] > > >> That is effectively what I am doing as well, only that I am not using a >> package but an environment and add it to the search path. >> > > [...] > > OK. I did not study your patches closely enough. Sorry. No problem. > > >> >>> >>> I also suggest that you introduce a customization variable to >>> allow a user to turn off the functionality you have created. >> >> I don't think this is necessary as the behavior for the user does not >> change at all, only that it becomes safer to use org variables in R (see >> above). >> > > All you have to do is add this: > > (defvar org-babel-R-assign-elisp-function 'org-babel-R-assign-elisp > "Name or definition of function to handle `:var name=value' > header args." > ) > > and change one line in org-babel-variable-assignments:R from > > (org-babel-R-assign-elisp to > > (funcall org-babel-R-assign-elisp-function > > and the user can provide her own elisp assignment function. > > This gives users who want special behavior like creating something > other than a data.frame the option of providing their own function. This assumes, that the user knows elisp. For many customizations this is necessary, but I would prefer a system where the user only has to provide an R function which will be used. This offers less customizability, but this would make it possible to use R to do the customization. To write a new org-babel-R-assign-elisp-function would be quite a challenge for an R programmer (like me...). Thanks, Rainer > > > 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