title: R command dir.create and file.path
body: <p>I've just started learning r and confused by the following question given in the course:</p>
  
  <p><strong>Create a directory in the current working directory called “testdir2” and a subdirectory for it called “testdir3”, all in one command by using dir.create() and file.path().</strong></p>
  
  <p>I couldn't get it to accept my answer and then found another site online giving the answers. This is the answer the other site gave:</p>
  
  <pre><code>dir.create(file.path('testdir2', 'testdir3'), recursive = TRUE)
  </code></pre>
  
  <p>After copy/pasting this answer it still didn't let me progress in the course. Is there something wrong with the answer?</p>
  
  <p>Also why would i want to use file.path to create the folders. Would it not make more sense to do this:</p>
  
  <pre><code>dir.create("testdir2/testdir3", recursive = TRUE)
  </code></pre>
  
  <p>What is the purpose of using the file.path function to create folders?</p>