title: Assign variable name to desired parts in a function in R
body: <p>I am new to R and here. Sorry If I am complicated. I created a function by <code>trial</code> name. There are some functions from my own function below. </p>
  
  <pre><code>write.table(pars, "C:\\Parameters\\pars_(variable name).txt")
  cov12lag1_(variable name) &lt;&lt;- acvf(half, 1)
  </code></pre>
  
  <p>Let's say I have two different data. Data names are <code>jan2005</code> and <code>jan2006</code>
  When I write function <code>trial(jan2005)</code> I want to get <code>pars_jan2005.txt</code> and also in my environment I want to see <code>cov12lag1_jan2005</code> automatically. </p>
  
  <p>Also, again when I want to write <code>trial(jan2006)</code>, again I want to see <code>pars_jan2006.txt</code> and <code>cov12lag1_jan2006</code> automatically.</p>
  
  <p>So these were only examples, my aim is when I write a variable in a function, I want all desired parts to be changed with variable name.</p>