title: R download.file with "wget"-method and specifying extra wget options
body: <p>I have a probably rather basic question to using the <code>download.file</code> function in R using the <code>wget</code> option and employing some of the wget extra options, but I just cannot get it to work. </p>
  
  <p>What I want to do: download a local copy of a webpage (actually several webpages, but for now the challenge is to get it to work even with 1).</p>
  
  <p>Challenge: I need the local copy to look exactly like the online version, which also means to include links/ icons, etc.. I found wget to be a good tool for this and I would like to specify some of the extra options, such as <code>--random wait</code>, <code>-p</code>, <code>-r</code>. I found some very helpful tutorials on this, however none of them employed the extra options in R, but rather in wget directly. </p>
  
  <p>So here is the code I have put together for this: </p>
  
  <pre><code>download.file('https://www.wikipedia.org/', destfile = "wikipage", method = "wget", extra = getOption("--random wait", "-r", "-p"))
  </code></pre>
  
  <p>which does not work. I suspect there are problems with both, the "wget" method and the specification of the extras. </p>
  
  <p>Can anyone help, it would be much appreciated? </p>
  
  <p>A bonus question: I know that the <code>destfile</code> is supposed to specify a file name for the downloaded document, but is there any way I could specify a folder through a path to which all downloaded files should be saved? </p>
  
  <p>Thank you in advance! </p>
  
  <p>Best
  Carolin </p>