title: Saving multiple data frames and return them from a function
body: <p>I have a snipet of code that reads all the files with a specific extension from a folder and each dataset is saved as a data frame with default name. The code was working fine untill I turned it into a function. The function runs fine but is not returning anything. I wanted to ask if there is a way of having this function return all the data frames?</p>
  
  <p>The function is below: </p>
  
  <pre><code>library(devtools); install_github(BioStatMatt/sas7bdat.parso)
  
  ReadFiles &lt;- function()
    {
    path &lt;- "C:/Users/abc/Desktop/abc/test/"
    files &lt;- list.files(path=path, pattern="*.sas7bdat")
      for(file in files)
        {
          perpos &lt;- which(strsplit(file, "")[[1]]==".")
          assign(
          gsub(" ","",substr(file, 1, perpos-1)), 
          read.sas7bdat.parso(paste(path,file,sep="")))
        }
    }
  </code></pre>
  
  <p>I will appreciate some guidance onto how I can make this function work.</p>
  
  <p>Thanks.</p>