For my job I have to write scripts that are upwards of 600 lines. It's important that my scripts are readable for my coworkers, but I noticed that even when reading my own code I need to scroll a lot to find a certain function.
The issue is not so much that the code is ugly or not commented - each line has a comment explaining what is being done and why. It's also organized - it follows a very predictable structure. What i'm strugglin with is all the vertical scrolling. It seems outdated. When i'm writing a word or latex document, I can create headers that are recognized by the software as index points. Those index points then show up in a table of contents.
Can I do something similar in R? Is there any programming language that allows for indexing points like this? Wikipedia does it too, for example the link https://en.wikipedia.org/wiki/Meteorological_history_of_Hurricane_Patricia#Peak_strength will take you to the paragraph about the peak strength of the hurricane.

