Best Practise Coding for R script running in production : <p>We have a linux production server and a number of scripts we are writing that we want to run on it to collect data which then will be put into a Spark data lake.</p>

<p>My background is SQL Server / Fortran and there are very specific <strong>best practices</strong> that should be followed. </p>

<ul>
<li>Production environments should be stable in terms of version control, both from the code point of view, but also the installed applications, operating system, etc.  </li>
<li>Changes to code/applications/operating system should be done either in a separate environment or in a way that is controlled and can be <em>backed out</em>.</li>
<li>If a second environment exist, then the possibility of parallel execution to test system changes can be performed.</li>
<li>(Largely), developers are restricted from changing the production environment</li>
</ul>

<p>In reviewing the R code, there are a number of things that I have questions on.</p>

<ul>
<li>library(), install.packages() - I would like to exclude the possibility of installing newer versions of packages each time scripts are run?</li>
<li>how is it best to call R packages that are scheduled through a CRON job? There are a number of choices here.</li>
<li>When using RSelenium what is the most efficient way to use a gui/web browser or virtualised web browser?</li>
</ul>
