title: How to save a function as new R script?
body: <p>Given a function, how to save it to an R script (.R)?</p>
  
  <p>Save works well with data, but apparently can not create .R data.</p>
  
  <p>Copy pasting from the console to a new script file appears to introduce characters that cause errors.</p>