[TxMt] Re: R directory

Ronald Wampler rdwampler at gmail.com
Fri Jun 27 18:27:11 UTC 2014


On Fri, Jun 27, 2014 at 8:26 AM, Ross Ahmed <rossahmed at googlemail.com>
wrote:

> Lets say I have a file on desktop called called ‘test.csv’. I discovered
> by accident that if I drag ‘test.csv’ to an R file, this code is pasted
> into the R file:
>
> read.csv(file = "../../../../Desktop/test.csv", header = TRUE,
> stringsAsFactors = FALSE)
>
> But if the file is a .xls file, only this get pasted into the R file:
>
> /Users/rossahmed/Desktop/test.xls
>
> How can I add a command that, when I drag a .xls file into an R file, this
> get pasted in:
>
> read.xls("/Users/rossahmed/Desktop/test.xls")
>

You will need to add a new "File Drop Action" to the R bundle. Have a look
at the "read.csv (*.csv)" action in the Bundle Editor (TM2 *Bundle → Edit
Bundles.. → R → File Drop Action → read.csv (*.csv))*. To create a new
"File Drop Action" use *⌘N → Drag Command.*




> _______________________________________________
> textmate mailing list
> textmate at lists.macromates.com
> http://lists.macromates.com/listinfo/textmate
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20140627/0ed5917f/attachment.html>


More information about the textmate mailing list