Questions tagged [rstudio]

RStudio is an IDE for the R statistical programming language. DO NOT use this tag for general R programming problems, just use the R tag. ONLY use for RStudio-specific questions.

RStudio is a free and integrated development environment () for and . It includes a console, syntax-highlighting ACE-based editor that supports direct code execution, as well as tools for plotting, history, debugging and workspace management.

RStudio is available in open source and commercial editions and runs on the desktop (, , and ) or in a browser connected to RStudio Server or RStudio Server Pro (Debian/Ubuntu, Red Hat Linux/CentOS, and SUSE Linux).

RStudio PBC, the organization behind RStudio IDE, is now officially named Posit PBC, rebranding some of its corporate products, notably Connect, Workbench and Package Manager.

Tag Usage

Only use this tag for specific RStudio issues such as GUI features, bugs, installation. Always make sure your questions are suited for Stack Overflow.

Related tags

Resources

7871 questions
73
votes
3 answers

Scale and size of plot in RStudio shiny

Related, but only talks about the allocated plot space in general, not how to directly set the plot image size and then scale it to fill the desired space Shiny Chart Space Allocation I'm creating a shiny web app and would like to set the size of…
Hendy
  • 10,182
  • 15
  • 65
  • 71
73
votes
4 answers

How to convert R Markdown to HTML? I.e., What does "Knit HTML" do in Rstudio 0.96?

What commands are run when pressing "Knit HTML" on an R Markdown file in Rstudio 0.96? My motivation is that I might want to run the same command when I'm in another text editing environment or I might want to combine the command in a larger…
Jeromy Anglim
  • 33,939
  • 30
  • 115
  • 173
71
votes
6 answers

The R console is in my native language, how can I set R to English?

I am using R on Windows 7. Apparently R somehow found evidence that I speak languages besides English, and stubbornly insists on giving output in the console in my own language. For a variety of reasons, this is undesirable, and I want R to be…
Superbest
  • 25,318
  • 14
  • 62
  • 134
68
votes
8 answers

How to use objects from global environment in Rstudio Markdown

I've seen similar questions on Stack Overflow but virtually no conclusive answers, and certainly no answer that worked for me. What is the easiest way to access and use objects (regression fits, data frames, other objects) that are located in the…
Adam Robinsson
  • 1,651
  • 3
  • 17
  • 29
67
votes
9 answers

Rtools not being detected by R

Update: I've written a brief walkthrough guide to installing Rtools on windows. Original: I am trying to build an R package using RStudio on Windows 7. When I attempt to build the package via RStudio's Build panel I receive: WARNING: Rtools is…
coatless
  • 20,011
  • 13
  • 69
  • 84
66
votes
7 answers

two-column layouts in RStudio presentations/slidify/pandoc

I'm trying to come up with a good system for generating slides and accompanying handouts. The ideal system would have the following properties: beautiful in both presentation (PDF/HTML) and handout (PDF) layouts (handouts should have room for…
Ben Bolker
  • 211,554
  • 25
  • 370
  • 453
63
votes
6 answers

Reset the graphical parameters back to default values without use of dev.off()

Such as margins, orientations and such... dev.off() does not work for me. I am often using RStudio, with its inbuilt graphics device. I then have plotting functions, which I want to plot either in the default RStudio graphics device, or if I called…
Cookie
  • 12,004
  • 13
  • 54
  • 83
60
votes
1 answer

Difference: "Compile PDF" button in RStudio vs. knit() and knit2pdf()

TL;DR What are the (possibly unwanted) side-effects of using knit()/knit2pdf() instead of the "Compile PDF"1 button in RStudio? Motivation Most users of knitr seem to write their documents in RStudio and compile the documents using the "Compile PDF"…
CL.
  • 14,577
  • 5
  • 46
  • 73
60
votes
6 answers

suppress console output in r markdown, but keep plot

Hi I have the following markdown chunk: ```{r, echo=FALSE,warning=FALSE,message=FALSE,error=FALSE} lapply(obj,function(x) plot(x,main="some plot") box() axis(1,at=seq(0,25,by=1)) ``` The output is multiple plots. However I also get the console…
brucezepplin
  • 9,202
  • 26
  • 76
  • 129
58
votes
1 answer

Persistent warnings from earlier commands with RStudio

I'm struggling to create a reproducible example for this, but I suspect others will know what I mean. Why does R sometimes seem to get stuck with a backlog of warnings/error messages that it repeats again after subsequent commands? E.g. you get…
geotheory
  • 22,624
  • 29
  • 119
  • 196
57
votes
4 answers

How do I open a script file in RStudio using an R command?

I have a simple script file called test.R. It's saved in the working directory. When I go to File > Open > test.R, it opens the file in the editor (without executing the code, which is what I want). How do I do this by typing a command in the…
user3654852
  • 753
  • 1
  • 5
  • 10
56
votes
10 answers

Rstudio difference between run and source

I am using Rstudio and not sure how options "run" and "source" are different. I tried googling these terms but 'source' is a very common word and wasn't able to get good search results :(
user2543622
  • 5,760
  • 25
  • 91
  • 159
54
votes
2 answers

How to use Rstudio relative paths

How can I use relative paths in a RStudio project environment? For example, to access a file, I use the whole path: # My RStudio project working directory: getwd() [1] "C:/Users/MaurizioLocale/OneDrive/Data_Science/10_Capstone_project/ …
Worice
  • 3,847
  • 3
  • 28
  • 49
54
votes
3 answers

R: In RStudio how do I make knitr output to a different folder to avoid cluttering up my drive?

I am using RStudio's knit HTMl function to output some presentations. But it always outputs the files to my current work directory. How can I make it output to another directory so that my directory is clean with only the original .rmd files?
xiaodai
  • 14,889
  • 18
  • 76
  • 140
53
votes
2 answers

How to run an entire R script at once

How do I run an entire R code script in RStudio? When I click on the Run button in RStudio, the code runs only on a line-by-line basis and I want it to execute all the code at once instead of running through line by line. So far the only method…
alphabeta
  • 687
  • 1
  • 6
  • 7