[TxMt] Sending an Entire Document to the R GUI

Ana Nelson nelson.ana at gmail.com
Mon Jul 3 08:41:08 UTC 2006


Here is a slight modification of one of the R Bundle commands which  
lets you send a file to be processed the R GUI. I started with the  
built-in “Send selection to R” which looks like this:

osascript -e 'tell application "R" to activate' -e "tell application  
\"R\" to cmd \"${TM_SELECTED_TEXT//\"/\\\"}\""

I replaced $TM_SELECTED_TEXT with source("$TM_FILEPATH"):

osascript -e 'tell application "R" to activate' -e "tell application  
\"R\" to cmd \"source(\\\"$TM_FILEPATH\\\")\""

I have a more detailed explanation here: http://love.agent.ie/ 
articles/2006/07/02/passing-scripts-to-the-r-gui

-Ana


More information about the textmate mailing list