Reputation: 4443
I have been looking for a solution to this problem but could not find a practical one. I have a long R script (more than 1500 lines).
I have the following text which repeats itself several times in the Script:
df00$StartDate
I need to add the following line of text just above it (everywhere where it occurs):
df00$`MealPlan` <- sub('\n.*', '', output3$`Your choices`)
Is there an efficient way to do this instead of scrolling through the Script and manually pasting that new line of code?
Upvotes: 1
Views: 311
Reputation: 56159
CTRL+F
search for df00$StartDate
, then click "All", then start editing, the edit will be done for all selected rows at the same time.
See screenshot, you will see a multiline cursor at the end of each line:
2015-05-06: RStudio v0.99 Preview: More Editor Enhancements
Upvotes: 2