title: How to return a data.frame with a given name from a function?
body: <p>Assume I have a function that reads data from a MySQL table, manipulates it and returns some data.frame. Note the function is just an example whose functionality does not matter itself..., E.g.: </p>
  
  <pre><code>addRowSd &lt;- function(table,con,pattern="^Variable") {
  
  dframe &lt;- dbReadTable(con,table)
  cn &lt;- colnames(dframe)
  qs &lt;- subset(x, x  %in% grep(pattern, x, value=TRUE))
  dframe$qsd &lt;- sd(t(dframe[,c(qs)])) 
  
  return(dframe)
  }
  
  mydf$sd &lt;- addRowSd(...)
  </code></pre>
  
  <p>I end up with a data.frame called mydf. Now I´d like to do to this to a character vector of SQL table names AND name the returned dataframes correspondingly. If I just use</p>
  
  <pre><code>x=lapply(MySQLtablenames,addRowSd,con)
  </code></pre>
  
  <p>I´ll get some list called x. Of course I could unlist and rename everything the way I´d like to, but my question is: </p>
  
  <p>How can I make lapply (or another comparable function) return multple single dataframes or at least a list that contains some names derived from my character vector "MySQLtablenames"?</p>