I am new to R and Rstudio and currently trying to figure out a few things that would easen switching too much between the linux-terminal and the file navigating system. As I prefer using the former I would therefore like a method that allows me to open .R files in R studios in-built editor but directly via the linux terminal. I have tried to illustrate what I want on the attached picture. Does this functionality exist? So far I have only been able to execute R scripts via the terminal.
I have trawled through the web trying to find a similar question but they all seem to be related to executing R scripts via the terminal rather than opening them in the Rstudio editor.
I'm using R, Windows 10 and Visual Studio 2015 in my work. I can do calculations well in R console. But as I tried to make a Visual Studio project, I was unable to see the result. My code is the following:
print(2)
I tried to execute in interactive by pressing Ctrl+Enter but I can't see the result. So where do the result should appear?
(I'm assuming you have R Tools from here)
There ought to be an R Interactive window option under the R Tools > Windows menu:
Now the outputs of your R scripts (derived by highlighting some lines and pressing Ctrl-Enter) should go to that window:
If that doesn't work, can you make sure you have the latest version of R Tools? Version 1.0 only just came out recently...
I just ran this in RStudio and it works fine.
Gender <- c("Female","Female","Male","Male")
Restaurant <- c("Yes","No","Yes","No")
Count <- c(220, 780, 400, 600)
DiningSurvey <- data.frame(Gender, Restaurant, Count)
DiningSurvey
Then I try to run it in Visual Studio and it does nothing at all.
If I go to Test > Run > All Tests, I get this: 'There were successful build errors. Would you like to continue and run tests from the last successful build?' There is no last build and no matter what I try, this doesn't work. IF I hit any function key, including F5, F11, or whatever, this doesn't work!! How can I run R code in Visual Studio? It seems like this should be super-simple, but it is very, very, very difficult.
Thanks.
In general, R in VS works same a R in RStudio. In other words, F5 does not work since R is not a compiled language and does not have predefined entry point. For example, for debugging you set a breakpoint, then attach debugger, then source file and then call the desired function from R interactive window.
To run R in Visual Studio, you need the R Tools for Visual Studio (RTVS) plugin.
You can download this at http://microsoft.github.io/RTVS-docs/
This will turn Visual Studio into a capable client that knows how to deal with R.
Once you've installed RTVS, the easiest way to get started is to create a new R project:
\File\New\Project...\New R Project
This will create a new project with templates for R and Rmd files.
You can send code from an R file to the "R Interactive" window by pressing Ctrl+Enter.
You can see this in action by watching the video at https://youtu.be/KPS0ytrt9SA
I have a vb.net program which processes some data and user input and then uses R.net to set this information into R objects and run R scripts on these objects.
My problem is that this is hard for me to debug, as the error messages that bubble back up through the Visual Studio debugger about the R scripts are often not helpful.
My latest solution to this is to add
engine.Evaluate("save.image('Scripts/debugging/image.RData')")
into my vb.net code just before the script that has an error. This allows me to load up the objects in my R IDE and check if everything is in the form I expect it to be.
I was wondering if there was a better way to do this? For instance I wonder is it possible to set up the R environment/engine to run a save.image() if an error is encountered automatically?
What would be the command line equivalent of a TFS* Merge action from within Visual Studio 2013? There seem to be various switches for the tf merge command so I'd like to know what the entire command would look like for the default behavior within Visual Studio 2013.
*TFS 2012
I'm expecting the result after running the command to be check-outs in TFS with merges to address within Visual Studio 2013.
I think you'll find that the very basic
tf merge folder1 folder2 /recursive
is what you're after.
Also, if you add preview to the command you'll be able to experiment with the various options until you get the result you're after. It's a great way to see how the merge works without worrying about damaging anything.