title: Creating R list as config object in JavaScript style
body: <p>I need a config object to keep some constants being used in my R code. These are url for remote file, directory for keeping downloaded files, local filenames to be used after downloading, etc.
  I'm R newbie that is why I decided to use JavaScript-like config object (particularly list) similar to something like this:</p>
  
  <pre><code>var config = {
      wd           : "/some/working/dir",
      zipSrc       : "http://www.example.com/remote_data_file.zip",
      data_dir     : "data",
      data_zip     : "data.zip",
      data_txt     : "data.txt",
      abs_data_dir : this.wd + this.data_dir,
      abs_data_zip : this.abs_data_dir + this.data_zip,
      abs_data_txt : this.abs_data_dir + this.data_txt
  };
  </code></pre>
  
  <p>Notice that one can use "this" to reference current object and made some calculation/assignments right inside it.</p>
  
  <p>The most distant place I reached in R is: </p>
  
  <pre><code>config &lt;- list(wd           = getwd(),
                 zipSrc       = "http://www.example.com/remote_data_file.zip",
                 data_dir     = "data",
                 data_zip     = "data.zip",
                 data_txt     = "data.txt")
  </code></pre>
  
  <p>But what if one still needs to calculate abs_data_dir and other similar values? Is it possible to do that job while "building" config list object? Is it possible to derive new named list members based on just created ones like using mutate() in dplyr package? If so is there in R any analogue to JS' "this" to reference current object?</p>