How to write and execute a hello world program in file for R?
===

I did look in here: http://cran.r-project.org/doc/FAQ/R-FAQ.html#R-Programming

Wikipedia shows how to write an on the fly R program: http://en.wikipedia.org/wiki/Hello_world_program_examples#R_2

**But how to execute this from a file?  
What extension needs to be given?   
How to compile the file then?**

on Linux.