Modifying R scripts within Power BI is extremely clunky. While the "Get Data" function allows you to copy an entire script character-for-character, it does not seem the Advanced Editor allows you to copy and paste the same way. R scripts appear on a single line in the editor with #(lf) wherever the original script has a line break; this makes it incredibly difficult to edit and tweak. A simple formatting change would go a long way to improving the editor.