It is possible to make a separate file for functions. When want to use the function, you will need to run the function before running your main code, so that the function is loaded into the workspace.
How to chain "if", "if else" and "else" statement [url]
String and Text
How to concatenate a vector of characters or strings [url]
R Console
clear screen console: Ctrl+L (for Windows). However, for any system you might want to read this.
How to remove all variables, but not function, from the workspace. [url]