0

In regular R code I can do the following (when I put pointer at long_string and execute:

long_string <- 'a
b'

So if I have a very long string then I can just hit Enter to split it and R Studio will understand.

In R-markdown the above does not work

```{r string test, echo = F}

long_string <- 'a
b'

```

If I put pointer at long_string and execute, I will end up with + in console, meaning that R is expecting end of line command.

One solution is to select whole expression (multiple lines) and run it, but I wonder if there are other solutions.

Phil
  • 7,287
  • 3
  • 36
  • 66
user1700890
  • 7,144
  • 18
  • 87
  • 183

1 Answers1

2

In Markdown, instead of activating the console via ctrl+ENTER you might want to run the entire Markdown Chunk by pressing CTRL+SHIFT+ENTER. Then you'll obtain the result right below the chunk.

CWebkas
  • 19
  • 1