Post

3 followers Follow
2
Avatar

options(width=xxx) not working in R Console ?

Hi,

When I try to change the display width in RConsole with options(width = 200) there is no effect and when displaying large data.frames the lines wrap to make it very difficult to read.

Suggestions ?

Cheers,
Chris

Ian Pylvainen

7 comments

0
Avatar

Chris,

The option(width = x) command will change the global setting which affects the way in which R displays its results. It will just wrap at a different point.

For example, try the following code and look at the difference:
1:100
options(width=42)
1:100

This happens in default R as well as RStudio. Thus I don't think there is anything necessarily wrong. If you want to expand the console to make your large datasets easier to read, you can change the width of the console by moving your mouse pointer inbetween the split of the left and right panes in Rstudio. A hand or directional arrow will appear and you can drag the console over to make it bigger.

Let me know if this does the trick,

Josh

Ian Pylvainen 0 votes
Comment actions Permalink
0
Avatar

In the traditional R Console, I can set options(width=300) and then it will line wrap at 300.

In RStudio, if I sent options(width=300) it wraps at the end of the current screen width of the RStudio console as opposed to at character 300. Assuming this is done because you have no horizontal scrolling bar in the Studio Console....something that is practically very useful when dealing with data.frames with multiple columns.

Thoughts ?

Cheers,
Chris

Ian Pylvainen 0 votes
Comment actions Permalink
0
Avatar

Chris,

Thanks for the clarity and now I think I see what you are looking for. We actually act the same as the RGui on Windows and Mac, but what you are suggesting is a good feature idea. This is something that we could look into as perhaps a preference to turn on/off. With this, it would allow the console to push out the data.frame, activate a scroll bar, and allow you to see the whole data.frame with wrapping at whichever character you set rather than the width of the console.

Let me know if this covers if for you and we will definitely look into it further.

Josh

Ian Pylvainen 0 votes
Comment actions Permalink
0
Avatar

That is a good summary.

In finance we deal with large numbers of columns and it is very painful when they wrap.

Cheers,
Chris

Ian Pylvainen 0 votes
Comment actions Permalink
0
Avatar

Chris,

I definitely hear you and thank you for helping us pin this down. A good feature for sure and we'll look into making it work!

All the best,

Josh

Ian Pylvainen 0 votes
Comment actions Permalink
2
Avatar

Has this ever been fixed?  options(width=xxx) is still not working for me.

Earl F Glynn 2 votes
Comment actions Permalink