Every time you run the script it creates a new R instance, so you will need to reload your environment every time the script runs.
If you want to keep your environment in memory, you might want to create a while loop which reads user input from console or from file and executes the function with new parameters.