title: How to write and execute a hello world program in file for R?
body: <p>I did look in here: <a href="http://cran.r-project.org/doc/FAQ/R-FAQ.html#R-Programming" rel="noreferrer">http://cran.r-project.org/doc/FAQ/R-FAQ.html#R-Programming</a></p>
  
  <p>Wikipedia shows how to write an on the fly R program: <a href="http://en.wikipedia.org/wiki/Hello_world_program_examples#R_2" rel="noreferrer">http://en.wikipedia.org/wiki/Hello_world_program_examples#R_2</a></p>
  
  <p><strong>But how to execute this from a file?<br>
  What extension needs to be given?<br>
  How to compile the file then?</strong></p>
  
  <p>on Linux.</p>
  
  <hr>
  
  <p>I created a file <code>mow.R</code> containing the following code:<br>
  <code>cat ('Hello world!')</code></p>
  
  <p>R says:  </p>
  
  <pre><code>&gt; source mow.R
  Error: unexpected symbol in "source mow.R"
  </code></pre>