Re: Efficiently reuse code in org babel with R

2022-07-07 Thread Naresh Gurbuxani
Thanks for providing a detailed solution. I also learned from other responses. Sent from my iPhone > On Jul 7, 2022, at 4:42 AM, Jeremie Juste wrote: > > Hello Naresh, > > Many thanks for sharing. > If I'm looking for efficiency, I tend not to use noweb and use an R > session instead. > >

Re: Efficiently reuse code in org babel with R

2022-07-07 Thread Jeremie Juste
Hello Naresh, Many thanks for sharing. If I'm looking for efficiency, I tend not to use noweb and use an R session instead. One reason is that caching does not work with noweb #+name: test #+begin_src R :cache yes :session *R* Sys.sleep(10) a <- 1 #+end_src #+RESULTS[36c41617bf9aa447ecc28fca

Re: Efficiently reuse code in org babel with R

2022-07-06 Thread Greg Minshall
Naresh, > I want to source some data from databases, then use this data in > various blocks. I am looking for the most efficient way to achieve > this. In below blocks, is the code in block ``connection'' executed > thrice (economy of code but no saving of time) or is it only executed > once the

Re: Efficiently reuse code in org babel with R

2022-07-06 Thread Vikas Rawal
Why not specify a :session so that data created by one block would remain available to subsequent blocks? V. On Thu, 7 Jul 2022 at 09:10, Naresh Gurbuxani wrote: > I want to source some data from databases, then use this data in various > blocks. I am looking for the most efficient way to achi

Efficiently reuse code in org babel with R

2022-07-06 Thread Naresh Gurbuxani
I want to source some data from databases, then use this data in various blocks. I am looking for the most efficient way to achieve this. In below blocks, is the code in block ``connection'' executed thrice (economy of code but no saving of time) or is it only executed once then used twice? I