title: R load script objects to workspace
body: <p>This is a rookie question that I cannot seem to figure out.  Say you've built an R script that manipulates a few data frames.  You run the script, it prints out the result.  All is well.  How is it possible to load objects created within the script to be used in the workspace?  For example, say the script creates data frame df1.  How can we access that in the workspace?  Thanks.</p>
  
  <p>Here is the script...simple function just reads a csv file and computes diff between columns 2 and 3...basically I would like to access spdat in workspace</p>
  
  <pre><code>mspreaddata&lt;-function(filename){
  
  # read csv file
  rdat&lt;-read.csv(filename,header=T,sep=",")
  
  
  # compute spread value column 2-3
  spdat$sp&lt;-rdat[,2]-rdat[,3]
  }
  </code></pre>