Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • wrapping lines together in do editor

    Hi statalister,

    I am wondering if there is a more efficient way to wrap a long line of code in the do file editor.

    I often find myself coping/pasting long lists of variable names (for instance to include them in a ML algorithm) from either other software or from the result window into a do file. Doing so, I end up with unwrapped columns of variable names. Worst, when the long command is pasted into a global, I can't even use the /// command. Is there a way to wrap long line of codes into R? When I am in this situation I end up changing the delimiter to ; before and after the line of code which works ok but is not super satisfactory.

    Can you think of any other ways?

    Thanks




  • #2
    At least in Windows, and I imagine in Mac and Linux as well, you can open the do-editor. On the Edit drop-down menu select Preferences. In the dialog box that opens up, select the General tab. A little more than half way down on the left, check the box next to Wrap lines. The lines will automatically wrap from there on.

    Comment


    • #3
      Hi,

      There is this option indeed but when you copy paste something from the result window it never wraps the line automatically. What I would like to do is control which lines are wrap. You see what I mean?

      Thanks anyway

      Comment


      • #4
        I don't know what to say. In my setup, it does wrap lines that are copy/pasted. That said, when the wrap lines box is checked, it does wrap everything. It does not enable you to selectively wrap some lines and not others. So perhaps it isn't what you are looking for.

        Comment


        • #5
          I see what's wrong. When you copy paste lines from the result window or from excel, they appear in colomns in the do file editor. In that specific case, there is no way to wrap them together manually. I think that would be a great add-on to the do file editor. As of now, the only option I believe is to do :

          Code:
          #delimit ;
          global cont_rf  "var1                              var2                           
          var 3 var 4"; 
          #delimit cr
          Which is fine.

          Thanks clyde

          Comment

          Working...
          X