randy3k / r-box Goto Github PK
View Code? Open in Web Editor NEWR package for Sublime Text 3
License: MIT License
R package for Sublime Text 3
License: MIT License
As far as I can tell R-Box either sends code to the R console OR Terminal OR iTerm. Is it possible to assign three different key bindings to those three options (in order to be able to switch between them)?
In Linux when using screen.
When you have a list say "lobj" that has names, say "o1" and "o2", then in R one can call lobj$o1 to see o1.
However, when executing lobj$o1 in sublime using ctl+enter, only lobj is executed. One has to add a backlash as lobj$o1 to execute it.
This would be a quick fix :). Thanks
I've disabled the default R package per the README, restarted sublime and R files remain un-syntaxed.
Hi. When I try to send a very large chunk of code to R (a few hundred lines), nothing happens. The R-box will only work if the chunk is relatively small (I guess up to about a hundred lines). Is there a limit to the buffer size, and could this be increased? Thanks
For Enhanced-R there was "experimental" compatibility with RStudio; is this the case with R-Box? Because I have been having some issues, other than the one you mentioned in the cited issue report about having to lift ⌘
immediately after sending code to RStudio with ⌘
+enter
. Namely, when sending code for the first time after opening a new session in RStudio, what is sent appears to be whatever is on the system's clipboard rather than the intended line of code in Sublime; i.e.:
I open a new session in RStudio, by closing and re-opening the program, by manually clearing the workspace with
rm(list=ls(all=TRUE)
or by manually restarting the session within RStudio from the Session
menu or with ⇧
+⌘
+F10
;
I use ⌘
+enter
to send R code from Sublime (I'm using ST3 [on a Mac]) to RStudio, which I've arranged by adding the following to the user R-Box.sublime-settings:
{
"App": "RStudio"
}
and what is sent to RStudio is the contents of my system's clipboard, not the specified line of R code.
N.B.:
This happens to me both with a quicker and a slower release of ⌘
.
I could not reproduce the issue with standard R. I tried quicker and slower releases of ⌘
, clearing the user R-Box settings file entirely and, also, specifying "R" as "App" in the R-Box settings:
{
"App": "R"
}
continue the discussion
R-Studio's text editor suggests functions from currently loaded libraries - would it be possible to add such a feature to R-box?
When I use SublimeREPL: R ("driven" by R-BOX of course), I manage to tell it to use the current folder as home folder. It saves a lot of confusion. The setting is "cwd": "$folder",
.
Sadly I haven't found how to do the same in RBox when using the R app (I'm using OS X).
Is it possible, and if yes, how?
When I put a dollar sign in a code example in roxygen using R-extended syntax it fouls up the syntax highlighting of the rest of the document. I can escape the dollar sign but then my package check fails. I'd take a crack at fixing it if I understood tmLanguage files.
I'd be nice to have the R help docs show up somewhere in the UI (not just fly by in the terminal or Sublime REPL). Maybe as a new tab ...
https://sublime.wbond.net/packages/SublimePeek-R-help seemed to have tried this, but it's dead.
If there's chinese comment in the code, then it can not be send to rgui.exe.
Is there any solution for this issue?
ConEmu is built on cmder foundations I think. It would be nice if there was a send to ConEmu option on windows.
I have installed RRO on a new macbook pro 13" retina (two cores) & Yosemite.
I tried with RSTUDIO and R 25 (S. Urbinek notorious benchmark) and I got the test time down from ~31 s to a blazing 5 s (thanks to multithreading and Intel MKL). Marvellous!
The problems are with Sublime text. I use Sublime text 3 as text console more often than rstudio for a variety of reasons.
I use it in conjunction with the package R-Box to drive where I want to send the code to: either to the R console, or with SublimeREPL R to direct the code to Sublime itself splitting the screen in two and sending the code to the right hand of the screen where I run the R console.
Normally I configure R-Box user settings with R, and SublimeREPL specifying the R path as /usr/bin/R (see below).
Results (sadly)
R-Box & R does not work: it cannot find the RRO app (even changing the name of the app from RRO to R it does not find it).
R-Box & SublimeREPL (i.e. the console in the right side of the screen) shows the console OK, but there is no visible prompt, hence it is of no use.
These are the R scripts that work with CRAN R:
{
"App": "R",
"osx":
{
"App": "SublimeREPL"
}
}
{
"default_extend_env": {"PATH": "{PATH};/usr/bin/R"},
"show_transferred_text": true
}
I did not think to post the issue I posted in stackoverflow here in the first place: apologies!
See http://stackoverflow.com/questions/26494145/issues-with-revolution-r-open-yosemite-sublime-text
Hi
I've been using R-box happily for a long time. But today it's suddenly not working. There's no syntax highlighting, and none of the short-cut keys work. I've removed and re-installed it a number of times.
Settings are as follows;
{
"R64": "C:\Program Files\R\R-3.1.3\bin\x64\Rgui.exe",
"auto_advance": true,
"auto_completions": true,
"prog": "R64",
"status_bar_hint": true
}
The path to R is correct. Settings are under Packages/User/...
Thanks
Nick
I love r-box
and I use with many other languages (because it works). However "execute in block" feature does not work in languages where function is defined without {}
. Is it hard to make it work with this kind of syntax?:
function foo()
a = 1
b = 2
return a + b
end
I read the code and found that it uses a fancy regex to grab functions. So decided to ask you for an advice before diving deeper.
Thanks.
This package: https://github.com/wuub/SublimeREPL enables you to run R inside sublime2, which is rather nice because you could have a two column view. Would be rather nice to send it to there instead of a separate R instance.
Hello,
when I select several lines of syntax and send them from ST to terminal or iterm, I get this type of error:
adm2 <- fre
Error: object 'fre' not found
The original line was:
adm2 <- fread("rawdata/institution/ic2012_data_stata.csv")
In other words, the syntax line is cut. If I select just that line, there is no problem.
Thanks!
I have reverted back to version 2.0.6 which works fine. I have not tried the intermediate versions.
I am running Sublime Text build 3065, R 3.1.1.
Unrelated: I have changed the behaviour of ctrl+b to save before sending executing "r_box_source_code".
When using a script which (dunno why) has tabs instead of spaces, R-Box doesn't work with tmux.
See http://hastebin.com/xumaxahoza.R - the line mu = -3 # mean
gets sent as multipleClasses= -3 # mean
.
With Sublime Text 3's default R syntax disabled, it seems that R-Box ignores my snippet directory, located under ~/Library/Application Support/Sublime Text 3/Packages/User
, if it is named "R" (or "r"); curiously, when the default R syntax is enabled I don't have the same problem. See here: http://youtu.be/tj1js5pwZTA.
(I dunno if it makes sense to say that R-Box seems to "ignore" my directory, but that's how it seems to me.)
Hi Randy,
When I highlight multiple lines of any R script in ST2 the application crashes. When I uninstall R-Box it does not freeze when I highlight text inside of R scripts. ST2 does not freeze when I highlight text inside of other types of scripts.
OS X 10.10.2, fresh installs of ST2 and R-Box as of this evening.
Thanks for the help!
When I re-indent a function like:
function_example <- function (a)
a + 1
I get
function_example <- function (a)
a + 1
It should not do this.
Hello,
When using Sublime-Text 3 with the latest R-Box, under Linux (Debian)-screen, I got "Remote command it too long" error when ever I used C+b on a long function.
A similar discussion is shown here
http://stackoverflow.com/questions/25484585/sublimetext-with-screen-remote-command-too-long
However, I compared the parts of your sendtext.py and the SendText.py in the discussion they seem similar.
Is there a way to solve it. Thanks.
Hi Randy,
I'm using ST3 and R-Box 2.0.4 under Ubuntu 14.04 and tmux R. It seems no hints were showed in status bar as you mentioned in this and enhanced-R packages. Shall I modify something to enable this function?
Thanks for the wonderful package.
James
I often use the "echo=TRUE" option when running the source command. Is it possible to add an option to the Cmd+b command so that echo=TRUE always?
When I try to open the external R window (e.g, press Ctrl+Enter) Rgui does not open and the following error message appears: http://imgur.com/wTcvLUm. It worked until Friday.
INFO
I am on Windows 7, 64 Bit, R-Box v2.3.1
I do set the path to R manually in the Package settings - R-Box - Settings User via
{
// path to Rgui.exe (for windows only)
"R64": "C:\Programme\R\R-3.1.2\bin\x64\Rgui.exe",
}
(using double backslashes)
If we want to Sweave - why doesn't the build file looks like this
{
"selector": "text.tex.latex.rsweave",
"working_dir": "${project_path:${folder}}",
"cmd": [ "R CMD Sweave $file --encoding=UTF-8" ],
"shell": true
}
Calling knitr leads to some issues using sweave only related commands, if one uses real Sweave.
I have been using this package (and its predecessor) for about an year now and I love it.
I had a situation in which I was running ST3 on my MacOS but my terminal was running Ubuntu via virtual machine. The virtual machine folders were mounted on the MacOS at this location: /Users/<username>/vm/
. Most common reason for such a workflow is because you want to develop on the same OS as production.
Anyways, this meant that I had to modify the path sent from ST3 via R-Box in the following manner:
/Users/<username>/vm/path/to/file.R
to /home/ubuntu/path/to/file.R
. As an example, instead of sending setwd("/Users/<username>/vm/path/to/file.R")
to the terminal, I needed to send this to the terminal: setwd("/home/ubuntu/path/to/file.R")
.
I did this by modifying the file sendtext.py
and the user settings and then re-packaging the R-Box package and using it. This worked great until ST3 updated R-Box automatically and I lost my changes. So, I decided to fork this repository and then make these changes. I have tested the changes on ST3 and everything works nicely. The changes are only a few lines.
Here is the change: https://github.com/ankur-gupta/R-Box/commit/9d87ec117e4df83fd37c72f73be299231de06124
Now, I am not sure if this is something a lot of people would want to have. If there is demand or utility for this, I'd like to send you a pull request. This way I won't have to keep on merging your changes into mine every so often.
Let me know what you think, @randy3k.
I see the options of tmux
and screen
, how can I send to R in gnome-terminal, pantheon-termin,...
instead.
Many thanks!
So once we install R-Box we should disable the regular "R" syntax package and instead use R-Box for all R files? I'm asking because the README didn't quite make it clear whether the disabling was required or merely optional. What happens if we don't disable the R package? Can we still use "R-Box"?
Sorry if this is a dumb question....
Hi,
I hope the issues are a good place to post this.
I installed R-box via package control without problems, but it's not running on my system (I have Maverics and Sublime 3). I checked and the User settings include "prog": "R".
I had REPL installed, I tried removing it but it didn't help.
Both R.app and Sublime Text.app are in the same /Applications folder.
I get no error message so I can't give any more information, it's just that hitting cmd+Enter doesn't open R or send any commands to it if R is open. It just inserts a new line in my sublime file.
Thanks
I love writing RMarkdown with R-Box in ST3, but it seems I can't get proper syntax highlighting and REPL-ing/Build System to work at the same time.
If I select AcademicMarkdown
as a syntax, highlighting for italics and even @Citations works fine, but no REPL or Build system or R highlighting.
Conversely, If I choose R Markdown, the above works fine, but I loose syntax highlighting for italics and other simple Markdown stuff.
What's up with that? My screw-up, or still a limitation?
Ps.: fantastic work! – It's like magic to have R in your ST3. No more IDEs.
eg: paste
vs paste0
% treated as a comment symbol in Rmd files (i.e., text after the % is grayed out) but will not be when evaluated by knitr
Sublime text 3 freezes for 1-2 sec when I open a parenthesis after a word in a .R file. I've uninstalled Rbox and everything works fine now. I think this problem appeared after I upgraded to Yosemite. Would you know what's happening?
I must be missing something. Is there any way to fix the above issue?
I want sublime to open a new R session when there isn't one open already to send the line of code, but use the existing R session when there is one open already.
I am using Sublime Text 3 on Windows 8.
How do I fix it
A bugreport:
After plotting, as long as the plotting device is opened, Crtl+Enter does not pass any lines of code on to R. This happens when I want to pass a single line to R while the plotting window is open. After I close the plotting window manually, passing code works like a charm.
Code to illustrate the issue: Note that the issue arises when passing the code line by line, not at once.
df = data.frame(x=c(1,1,2)) #will be executed
plot(df) #will be executed
# Now suppose I just typed this new line
mean(df$x) #will not be executed
The issue occurred somwehen within the last version update(s).
Specs:
Windows 7, 64 bit, SublimeText 3, R-Box v2.3.3, using R in an external window.
Error in file(file, ifelse(append, "a", "w")) :
cannot open the connection
Calls: cat -> file
In addition: Warning message:
In file(file, ifelse(append, "a", "w")) :
cannot open file 'packages/base.json': No such file or directory
Execution halted
This failure happens because packages
is not yet created. We can either add a line to the packages.R
script to create the folder or change the instructions in the README.md to ask the users to create the packages
folder themselves.
Hi Randy
I'm having problems getting this to work as Sublime Text cannot find R. I've tried
Any help greatly appreciated
Nick
The R Sweave build does not work with Windows, because of the path separator ('/' instead of '').
Hi,
I am testing lines of code from R-Box. I am on Mac 10.8, R version 3.1.2. The syntax highlighting works fine, but when I try to run code using cmd+return, nothing happens. I've made no changes to the default preference settings. I tried to remove and uninstall the R-Box package and reinstall but the issue persists.
I have installed RRO on a new macbook pro 13" retina (two cores) & Yosemite. I tried with RSTUDIO and R 25 (S. Urbinek notorious benchmark) and I got the test time down from ~31 s to a blazing 5 s (thanks to multithreading and Intel MKL). Marvellous!
The problems are with Sublime text. I use Sublime text 3 as text console more often than rstudio for a variety of reasons.
I use it in conjunction with the package R-Box to drive where I want to send the code to: either to the R console, or with SublimeREPL R to direct the code to Sublime itself splitting the screen in two and sending the code to the right hand of the screen where I run the R console.
Normally I configure R-Box user settings with R, and SublimeREPL specifying the R path as /usr/bin/R (see below).
Results (sadly)
R-Box & R does not work: it cannot find the RRO app (even changing the name of the app from RRO to R it does not find it).
R-Box & SublimeREPL (i.e. the console in the right side of the screen) shows the console OK, but there is no visible prompt, hence it is of no use.
These are the R scripts that work with CRAN R:
{
"App": "R",
"osx":
{
"App": "SublimeREPL"
}
}
{
"default_extend_env": {"PATH": "{PATH};/usr/bin/R"},
"show_transferred_text": true
}
I did not think to post the issue I posted in stackoverflow here in the first place: apologies!
See http://stackoverflow.com/questions/26494145/issues-with-revolution-r-open-yosemite-sublime-text
Hello,
I have two issues:
I am very new to GitHub, so I hope that this is the right place to ask for this problems.
However, I would like to thank the creator of R-Box for his great 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.