karthik / rtools Goto Github PK
View Code? Open in Web Editor NEWSublime text package for R
Sublime text package for R
Are there step by step instructions for how to get this to work on windows? I tried changing the R64 to R.exe in the Rtools.py file but it still didn't work. I also changed the key bindings to something more windows friendly, but it still didn't work. Any suggestions?
I just upgraded to ST3, but unfortunately, RTools doesn't seem to send R code to the R (3.0.0) window as it does in ST2. I wonder if there's a quick workaround for this.
Hi,
building on my last issue, the actual goal is to have function tooltip as shown here for Notepad++ (second screenshot):
http://yihui.name/en/2010/08/auto-completion-in-notepad-for-r-script/
That would really be useful but the current ST2 architecture only offers limited ways to do that. Take a look at this thread for a discussion about that:
http://www.sublimetext.com/forum/viewtopic.php?f=2&t=2670
and you can also cote for the issue here:
http://sublimetext.userecho.com/topic/54838-/
As long as ST2 does not support tooltips, a workaround would be to put the function help in the status bar. SublimeCodeintel does that for some languages. I think that the content of the tooltips can be automatically generated from R and saved in a json file (based on the script of the completion file I mentioned in the other issue). For example, for rnorm the tooltip should look like
rnorm(n, mean = 0, sd = 1)
to show the arguments and the default values.
If you are interested in working on this, I could cover the R side (i.e. automatically generate the json file with the tool tips). Maybe there is also a better way to achieve this...
Great tool! Thanks for creating this. I am a long-time macvim user just moving over to SE2. Your Rtools package is making the transition a lot smoother for me.
I'd luv to be able to compile Rmd files as well. The following works on mac as a 'build-system'. Issue is it opens a new tab/browser each time you recompile. Is this still something you are working on?
"cmd": ["osascript", "-e", "tell app "R64" to cmd "file <- '$file'; knit2html(file); browseURL(sub('.Rmd','.html',basename(file)))"\n"]
Hi,
here is another suggestions for a possible future feature. Not sure whether my thoughts on an actual implementation are reasonable. Note that this would actually extend SublimeLinter (https://github.com/Kronuz/SublimeLinter) and not Rtools.
Here is how I think it could work:
EDIT: Simple example
require(svTools)
# no lint warning
lint(text="summary(rnorm(100))")
# lint warning for additional )
lint(text="summary(rnorm(100)))")
# output:
# line column message type
#4 1 1 unexpected ')' error
Cmd+B ("super+b") conflicts with the default keybinding for "build". See the file Packages/Default/Default (OSX).sublime-keymap:
{ "keys": ["super+b"], "command": "build" },
The recent change breaks the default keybinding. It took me a while to track the culprit to R Tools. Maybe it would be possible to setup a build system for R so that "build" command either launches R in batch mode, or sources the current file in the R GUI?
To get the build-system from R-tools to be selected automatically I had to add a 2nd line to the R.sublime-build file
{
"cmd": ["osascript", "-e", "tell app "R64" to cmd "source('$file')"\n"],
"selector": "source.r"
}
Hi,
I am not sure how auto completions work for you but I create a R.sublime-completions file at one point. Here is a description:
So the auto completions come from different sources. One is the sublime-completions file. Check out my R.sublime-completions to see whether such a file improves the auto-complete proposals ST2 makes. I can't really tell whether it makes a difference because it's to long ago that I added this file. Here it is (I think you just have to put it in your packages/R folder:
https://gist.github.com/2336626
Note that this file includes functions that are particular to my packages and my own functions. So it will make suggestions that do not make sense for you occasionally. If such the sublime-completions file improves auto-completion for R, I can send you code for the Rtools package that automatically creates a auto-completion based on the currently loaded packages in R. It's not going to be straight forward to integrate this code in the ST2 package but it would be possible to create a R.sublime-completions for the base and some popular R packages or invest some time to integrate the automatic creation of the file in Rtools.
I usually use R from the terminal, and run multiple sessions at once. It would be nice to be able to:
Sys.getpid()
, and somehow give the ST Rtools plugin that pid.According to the doucmentation: "...select first line of a function till the first {, press keybinding and it will generate a template with @params from the function definition..."
which keybinding? Could you make it more clear exactly what is required to get this to work?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.