Coming to Rstudio from plain R, I'm very confused about text scripts vs. code, which is coming up in the context of debugging. If I double click on a function in the enivronment list, it calls view(foo) and opens it for viewing, but not editing. However, if I want to edit it, apparently I need to open a script (text) file (or create one by cut-and-paste). I can run it using the little run button. But how do I turn it into an R function? It still does not show up in my environment list. How does "source" fit into this?
Finally, how do I then link the script with the R function for debugging purposes? I can make this work by using edit(foo) or fix(foo) in the traditional R fashion, but then I am editing in an editor window.
Obviously I'm very confused. Thanks!