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
52
votes
5 answers

How to output text in the R console without creating new lines?

I would like to output a progress indicator during my lengthy running algorithms. I can easily "bubble up" a progress value from within my algorithm (e.g. via invoking a provided function callback specifically for this purpose), but the difficulty…
DuckMaestro
  • 15,232
  • 11
  • 67
  • 85
51
votes
2 answers

In RStudio/RMarkdown, how to setwd?

setwd in an Rmd file in RStudio does not appear to change the directory in subsequent chunks. Is there a way to set the working directory for good? Example: ```{r} setwd("/tmp") getwd() ``` ```{r} getwd() ``` Output: setwd("/tmp") getwd() ## [1]…
user650654
  • 5,630
  • 3
  • 41
  • 44
49
votes
1 answer

Renaming RStudio project under version control

What's the right way to rename an RStudio project (esp., when that project is under version control)? E.g., I created an RStudio project with version control in "~/myproject". Then I decided I wanted to rename the project to "myproject1". So I…
lowndrul
  • 3,715
  • 7
  • 36
  • 54
49
votes
7 answers

Setting work directory in knitr using opts_chunk$set(root.dir = ...) doesn't work

My R project is structured like a package with directories /R, /vignettes, /data etc. In one of my Rmd docs in /vignettes I source a script which in located in /R. Inside this script I use read.csv() to load a file located in inst/extdata/. The…
Thomas Neitmann
  • 2,552
  • 1
  • 16
  • 31
49
votes
11 answers

How to add a page break in word document generated by RStudio & markdown

I writing a Word document with R markdown in R Studio. I can get many things, but at the moment I am not figuring out how can I get a page break. I have found solutions but only for rendered latex / pdf document that it is not my case.
Giorgio Spedicato
  • 2,413
  • 3
  • 31
  • 45
47
votes
4 answers

How to indent multiple lines of code in Rstudio?

I have tried using "reindent lines" after highlighting the lines but that doesn't work (in fact it removes indentation). For example I want a quick way to take a script like this #parameters b=2 c=1 d=4 q=3 and turn it into this #parameters …
WetlabStudent
  • 2,556
  • 3
  • 25
  • 39
45
votes
2 answers

How can I use spell check in Rmarkdown?

I want to write a report with Rmarkdown. However, I am a little worried about my spelling. I hope there is a package installed in my Rstudio which can automatically help me spell check. So, is there such a package or is there a way to solve this…
medfordwinter
  • 577
  • 1
  • 5
  • 6
45
votes
5 answers

What is a neat command line equivalent to RStudio's Knit HTML?

What is a neat command line equivalent to RStudio's Knit HTML? Given an .Rmd file, you can use RStudio to knit .html, .docx and .pdf files using Knitr. It would be great to shift this process completely to the command line. My approach so…
elke
  • 1,220
  • 2
  • 12
  • 24
45
votes
2 answers

In R markdown in RStudio, how can I prevent the source code from running off a pdf page?

I currently have some code that looks like so: ```{r, tidy=TRUE} plot(DT$age, DT$height, xlab = "Age of participant in Trials", ylab = "Height of participant in Trials") ``` Now, it was my understanding that setting tidy to TRUE would make it…
user1398057
  • 1,109
  • 1
  • 11
  • 15
45
votes
1 answer

Operator "[<-" in RStudio and R

By accident i've encountered strange behaviour of "[<-" operator. It behaves differently depending on order of calls and whether i'm using RStudio or just ordinary RGui. I will make myself clear with an example. x <- 1:10 "[<-"(x, 1, 111) x[5] <-…
BartekCh
  • 920
  • 6
  • 15
45
votes
6 answers

Conflict with xlsx package and choose.files

I'm having a strange problem with loading the xlsx package and using choose.files. This problem began as soon as I updated RStudio to the newest version (v0.97.237). If I start RStudio and then load xlsx (i.e. library(xlsx)) the package loads…
James
  • 479
  • 4
  • 4
43
votes
8 answers

How to get unsaved script tabs

I would like to know, if it is possible to get unsaved script tabs in R studio. I accidentally open and switch to new project, then my unsaved scripts disappeared. Can anyone help to get my unsaved script tabs.
Agaz Wani
  • 5,514
  • 8
  • 42
  • 62
43
votes
14 answers

pandoc document conversion failed with error 43 : pdflatex: The memory dump file could not be found

RStudio : 0.98.994 OS: Microsoft Windows 7 Ultimate Edition, 64-bit Service Pack 1 MiKTeX: 2.9.4503 Hi, I get the following error when I try to knit a PDF document. pandoc.exe: Error producing PDF from TeX source. This is pdfTeX, Version…
43
votes
5 answers

Restart R within Rstudio

I'm trying to call a simple python script from within R using system2(). I've read some information I found vague that said if 'too much' memory is used, it won't work. If I load a large dataset and use some information in it to use as arguments to…
Ben Hunter
  • 876
  • 1
  • 8
  • 18
43
votes
2 answers

How to hide code in RMarkdown, with option to see it

I'm writing an RMarkdown document in which I'd like to re-run some chunks (5 to 9). There's no need to display these chunks again, so I considered using ```{r echo=FALSE} to make the rerun chunks invisible, as described in another stackoverflow…
RobinLovelace
  • 4,799
  • 6
  • 29
  • 40