Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The first part of Doug's response offers the simplest immediate solution... add</p> <pre><code>source('/Users/briandk/.Rprofile') </code></pre> <p>to the head of any .r files you want those functions in... with that one line of code, you get your utility functions. Of course, that only helps if you're running the whole TM file.</p> <p>Ideally, the bundle will be updated... perhaps to support a shell variable via TM's preferences???</p> <pre><code>TM_RPROFILE </code></pre> <p>which could be set to the path to your .Rprofile file. </p> <p>I just hacked this into tmR.rb with just 2 lines of code. To implement this, go to ~/Library/Application Support/TextMate/Pristine Copy/Bundles/ and Show the Contents of R.tmbundle</p> <p>In there, you'll find support/tmR.rb</p> <p>in my version, near line 112, you should change</p> <pre><code>tmpDir = File.join(ENV['TMP'] || "/tmp", "TM_R") recursive_delete(tmpDir) if File.exists?(tmpDir) # remove the temp dir if it's already there Dir::mkdir(tmpDir) # Mechanism for dynamic reading # stdin, stdout, stderr = popen3("R", "--vanilla", "--no-readline", "--slave", "--encoding=UTF-8") stdin, stdout, stderr, pid = my_popen3("R --vanilla --slave --encoding=UTF-8 2&gt;&amp;1") # init the R slave stdin.puts(%{options(device="pdf")}) stdin.puts(%{options(repos="#{cran}")}) </code></pre> <p>to</p> <pre><code>tmpDir = File.join(ENV['TMP'] || "/tmp", "TM_R") recursive_delete(tmpDir) if File.exists?(tmpDir) # remove the temp dir if it's already there Dir::mkdir(tmpDir) rprofile = (ENV['TM_RPROFILE'] == nil) ? "" : "source('" + ENV['TM_RPROFILE'] + "')" # Mechanism for dynamic reading # stdin, stdout, stderr = popen3("R", "--vanilla", "--no-readline", "--slave", "--encoding=UTF-8") stdin, stdout, stderr, pid = my_popen3("R --vanilla --slave --encoding=UTF-8 2&gt;&amp;1") # init the R slave stdin.puts("#{rprofile}") stdin.puts(%{options(device="pdf")}) stdin.puts(%{options(repos="#{cran}")}) </code></pre> <p>Just added 2 lines there... the one that begins "rprofile =" and the one that includes "#{rprofile}"</p> <p>-Wil</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload