title: Install R in docker image
body: <p>How do I install R version 3.4.0 in my docker image. I've installed python using:</p>
  <pre><code>RUN yum -y install https://centos6.iuscommunity.org/ius-release.rpm \
    &amp;&amp; yum -y install python36u \
    &amp;&amp; yum -y install python36u-devel \
    &amp;&amp; yum -y install python36u-pip \
    &amp;&amp; yum -y install python36u-tkinter.x86_64
  </code></pre>
  <p>Similarly I need to install R:</p>
  <p>I've specified following things in file so far for R:</p>
  <pre><code>ENV R_BASE_VERSION 3.4.0
  RUN Rscript -e 'install.packages(&quot;devtools&quot;,dependencies=TRUE)' \
      &amp;&amp;Rscript -e 'install.packages(&quot;methods&quot;,dependencies=TRUE)' \
      &amp;&amp;Rscript -e 'install.packages(&quot;jsonlite&quot;,dependencies=TRUE)' \
  </code></pre>
  <p>Please suggest .I'm new to docker</p>
  <p>I think I need to do something like below:</p>
  <pre><code>ENV R_BASE_VERSION 3.4.1
  
  ## Now install R and littler, and create a link for littler in /usr/local/bin
  ## Also set a default CRAN repo, and make sure littler knows about it too
  RUN apt-get update \
      &amp;&amp; apt-get install -t unstable -y --no-install-recommends \
          littler \
                  r-cran-littler \
          r-base=${R_BASE_VERSION}* \
          r-base-dev=${R_BASE_VERSION}* \
          r-recommended=${R_BASE_VERSION}* \
          &amp;&amp; echo 'options(repos = c(CRAN = &quot;https://cran.rstudio.com/&quot;), download.file.method = &quot;libcurl&quot;)' &gt;&gt; /etc/R/Rprofile.site \
          &amp;&amp; echo 'source(&quot;/etc/R/Rprofile.site&quot;)' &gt;&gt; /etc/littler.r \
      &amp;&amp; ln -s /usr/share/doc/littler/examples/install.r /usr/local/bin/install.r \
      &amp;&amp; ln -s /usr/share/doc/littler/examples/install2.r /usr/local/bin/install2.r \
      &amp;&amp; ln -s /usr/share/doc/littler/examples/installGithub.r /usr/local/bin/installGithub.r \
      &amp;&amp; ln -s /usr/share/doc/littler/examples/testInstalled.r /usr/local/bin/testInstalled.r \
      &amp;&amp; install.r docopt \
      &amp;&amp; rm -rf /tmp/downloaded_packages/ /tmp/*.rds \
      &amp;&amp; rm -rf /var/lib/apt/lists/*
  </code></pre>
  <p>But I do not know what is this litter and all. I just need R to be installed and then i will install required packages as I have specified above.</p>
  <h1>Edits : First line in my docker file installs node4.</h1>