Vertical line in script

Hello all

Quick question I have recently started using R. Somehow I now have a vertical line in the script and every time I open a new script it appears.
It goes down vertically from the run button.

Can someone explain to me how I can delete it again?

Thanks and greetings

That's the "margin column" which is on by default (at a width of 80 characters). You can turn it off by going to Global Options, then go to the Code section and select the Display tab at the top. If you uncheck the radio button that reads Show margin (see picture), the line will disappear once you hit Apply and/or OK and exit the settings pane.

1 Like

It worked. Great - thank you for your help.

Haha, I had the same but didn't care enough to check where this might come from.

Is there a reason for this, will it make sense to show a margin? To prevent line breaks or so? Why 80, seems quite short to me.

It's a pretty common width for wrapping, especially in Markdown. I know, for example, when reviewing other people's Rmd and Qmd on GitHub, it's very helpful to be able to comment on lines separated either by width or by sentence, rather than have a comment connected to a whole paragraph.

I know in terms of accessible web copy, the optimal line length for reading for the human eye is between 50 and 75 characters, but that's about reading (and I don't think the research was done with coding/monospaced fonts).

Obviously, you can turn off the margin line, or change the width to whatever you prefer. I found this one post from someone who's clearly a fan of 80-character width:

Edit Apparently wrapping is a contentious topic. If you're curious, I found the post below interesting:

Interesting discussion.
This sounds reasonable:
"GitHub's default behavior for PR review is to present the diff in a split screen; the existing code on the left, your proposed change on the right. Wrapping code at 80 characters ensures that these two panes sit comfortably side-by-side on a single screen, and that GitHub doesn't have to wrap the code onto extra lines that don't exist in the original file."

I just started to remove excessive line-breaks in my code as it's getting too long and takes too long to scroll up and down, maybe I should nevertheless try to stay within the 80-100 characters...

Historically, I believe the 80 character "limit" came from IBM punch cards that allowed 80 characters for code and a few characters for a sequence number in case you dropped a few hundred cards on the flour and needed to put them back in order.

These cards could also be used as bookmarks, somewhere to write grocery lists, and even postcards.

1 Like

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.