1

Is there any way to paste into the RStudio script pane without having the code auto indent itself, AND without turning off the auto indent feature?

Example

The output of dput(iris) looks organised in the console, but spreads very wide when pasted into the script pane. This is not great for code readability, and also for other things like copy/pasting into Stack Overflow or other code editors

In console:

enter image description here

After pasting into script pane:

enter image description here

Notes

  • Similar question and use cases have been put on the RStudio blog, but the main solution seems to be to turn auto indent off in the Tools menu, but I cannot find a temporary solution suitable for intermittent pasting
stevec
  • 41,291
  • 27
  • 223
  • 311
  • 2
    As it is about "copy/pasting into Stack Overflow", see related (Possible duplicate) post? https://stackoverflow.com/q/18746456/680068 – zx8754 Mar 19 '20 at 08:10

0 Answers0