<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
    <channel>
        
        <title>
            <![CDATA[ jupyterhub - freeCodeCamp.org ]]>
        </title>
        <description>
            <![CDATA[ Browse thousands of programming tutorials written by experts. Learn Web Development, Data Science, DevOps, Security, and get developer career advice. ]]>
        </description>
        <link>https://www.freecodecamp.org/news/</link>
        <image>
            <url>https://cdn.freecodecamp.org/universal/favicons/favicon.png</url>
            <title>
                <![CDATA[ jupyterhub - freeCodeCamp.org ]]>
            </title>
            <link>https://www.freecodecamp.org/news/</link>
        </image>
        <generator>Eleventy</generator>
        <lastBuildDate>Fri, 29 May 2026 23:04:20 +0000</lastBuildDate>
        <atom:link href="https://www.freecodecamp.org/news/tag/jupyterhub/rss.xml" rel="self" type="application/rss+xml" />
        <ttl>60</ttl>
        
            <item>
                <title>
                    <![CDATA[ How to Run R Programs Directly in Jupyter Notebook Locally ]]>
                </title>
                <description>
                    <![CDATA[ R is a popular programming language that’s now widely used in research-related fields like Bioinformatics. And to use R, you’ll need to install the R Compiler and R Studio. But did you know that you can also directly run your R code right in a Jupyte... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-run-r-programs-directly-in-jupyter-notebook-locally/</link>
                <guid isPermaLink="false">66feeca1dbd895463237bf4b</guid>
                
                    <category>
                        <![CDATA[ R ]]>
                    </category>
                
                    <category>
                        <![CDATA[ R Language ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Jupyter Notebook  ]]>
                    </category>
                
                    <category>
                        <![CDATA[ jupyterhub ]]>
                    </category>
                
                    <category>
                        <![CDATA[ jupyter ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Miniconda ]]>
                    </category>
                
                    <category>
                        <![CDATA[ anaconda ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Md. Fahim Bin Amin ]]>
                </dc:creator>
                <pubDate>Thu, 03 Oct 2024 19:12:33 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/pUAM5hPaCRI/upload/d8014cab22d10f9bade9077d0d4af34b.jpeg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>R is a popular programming language that’s now widely used in research-related fields like Bioinformatics.</p>
<p>And to use R, you’ll need to install the R Compiler and R Studio. But did you know that you can also directly run your R code right in a Jupyter Notebook? This helps in so many ways if you are already used to using Jupyter Notebook for Machine Learning-related tasks using Python.</p>
<p>In this tutorial, I’ll show you exactly how you can set up your local machine to run the R programming language directly in Jupyter Notebook. The processes I am going to show you today are equally applicable to all major operating systems (Windows, MacOS, and Linux OSes).</p>
<h2 id="heading-table-of-contents">Table of Contents</h2>
<ul>
<li><p><a class="post-section-overview" href="#heading-install-conda">Install Conda</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-create-a-new-environment">Create a New Environment</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-activate-your-conda-environment">Activate Your Conda Environment</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-install-ipykernel-and-jupyter">Install ipykernel and jupyter</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-install-r-in-the-conda-environment">Install R in the Conda Environment</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-open-the-jupyter-notebook">Open the Jupyter Notebook</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-run-r-in-jupyter-notebook">Run R in Jupyter Notebook</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-conclusion">Conclusion</a></p>
</li>
</ul>
<h2 id="heading-install-conda">Install Conda</h2>
<p>You’d normally use Conda to handle multiple environments in Python. And here, we’re going to use the same Conda program to install R in our environment. You can either use <a target="_blank" href="https://www.anaconda.com/">Anaconda</a> or <a target="_blank" href="https://docs.anaconda.com/miniconda/">Miniconda</a>.</p>
<p>I prefer Miniconda as it’s so lightweight. You’ll also get the opportunity to install the latest packages directly using Miniconda. But you can simply go with the Anaconda if you are already comfortable with that.</p>
<h2 id="heading-create-a-new-environment">Create a New Environment</h2>
<p>Many people tend to use the Base environment. But I never like to use the Base environment directly as you typically need multiple environments for handling different package and versions of packages as well.</p>
<p>So I’ll create a new environment where I’ll work on my R programming language-related tasks using Jupyter Notebook.</p>
<p>To create a new Conda environment, simply use the following command:</p>
<pre><code class="lang-bash">conda create --name r-conda
</code></pre>
<p>Here, <code>r-conda</code> is my Conda environment’s name. You can choose any other name, but keep in mind that the conda env name can not have any whitespaces in it.</p>
<p>It will create a new Conda environment named <code>r-conda</code> for me.</p>
<h2 id="heading-activate-your-conda-environment">Activate Your Conda Environment</h2>
<p>If you want to work on a separate conda environment, you’ll need to make sure that you’re activating that specific conda environment before starting to do anything.</p>
<p>I want to work on the <code>r-conda</code> conda environment. So I can simply activate the conda environment using the following command:</p>
<pre><code class="lang-bash">conda activate r-conda
</code></pre>
<p>You need to use the exact conda env name that you want if it’s different than <code>r-conda</code> in the command.</p>
<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text">Keep in mind that you need to activate the conda environment successfully before proceeding further.</div>
</div>

<p>You will see the conda environment’s name as <code>(conda-env-name)</code> at the left side of your terminal.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1727898007890/f8bf9ced-6c9e-4198-9116-63a32e7d0f03.png" alt="activate conda env" class="image--center mx-auto" width="1097" height="553" loading="lazy"></p>
<h2 id="heading-install-ipykernel-and-jupyter">Install <code>ipykernel</code> and <code>jupyter</code></h2>
<p>I always like to install the <code>ipykernel</code> and <code>jupyter</code> in all of my conda environments as they help manage different conda environments’ Jupyter notebooks/labs separately.</p>
<p>So I’m going to install them together in my conda env by using the command below:</p>
<pre><code class="lang-bash">conda install ipykernel jupyter
</code></pre>
<p>This will install both <code>ipykernel</code> and <code>jupyter</code> in the activated conda environment.</p>
<h2 id="heading-install-r-in-the-conda-environment">Install R in the Conda Environment</h2>
<p>To install R directly in the conda environment, simply use the following command:</p>
<pre><code class="lang-bash">conda install -c r r-irkernel
</code></pre>
<p>This will install the necessary components that enable your local computer to run the R program in your Jupyter Notebook.</p>
<h2 id="heading-open-the-jupyter-notebook">Open the Jupyter Notebook</h2>
<p>Now you can open the Jupyter Notebook either by using <code>jupyter notebook</code> or <code>jupyter notebook --ip=0.0.0.0 --port=8889 --no-browser --allow-root --NotebookApp.token=''</code>. Just make sure to modify the IP, port, root configuration, and token as you see fit for your work.</p>
<p>Open the given link in the terminal to open Jupyter Notebook in your web browser.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1727898291254/b932284e-05af-4eec-a6aa-f6b9ad50dd1c.png" alt="Open Jupyter Notebook" class="image--center mx-auto" width="1094" height="541" loading="lazy"></p>
<h2 id="heading-run-r-in-jupyter-notebook">Run R in Jupyter Notebook</h2>
<p>After opening Jupyter Notebook in your web browser, when you want to create a new notebook for R, you will get <code>R</code> directly in the “New” menu like the image given below.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1727898368089/a2d22b41-8ddd-480b-aaa4-65aeafb12f69.png" alt="R in notebook" class="image--center mx-auto" width="357" height="268" loading="lazy"></p>
<p>Now, you can use the R language directly in your Jupyter Notebook!</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1727898457072/05015331-742c-49c5-9325-b1d1cb1fc6cd.png" alt="Run &quot;R&quot; in Jupyter Notebook" class="image--center mx-auto" width="1244" height="524" loading="lazy"></p>
<p>You can also see the R programming language logo at the top right side of your Notebook.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Thank you for reading the entire article. I hope you have learned something new here.</p>
<p>If you have enjoyed the procedures step-by-step, then don't forget to let me know on <a target="_blank" href="https://twitter.com/Fahim_FBA">Twitter/X</a> or <a target="_blank" href="https://www.linkedin.com/in/fahimfba/">LinkedIn</a>. I would appreciate it if you could endorse me for some relevant skillsets on <a target="_blank" href="https://www.linkedin.com/in/fahimfba/">LinkedIn</a>. I would also recommend that you subscribe to my <a target="_blank" href="https://youtube.com/@FahimAmin">YouTube channel</a> for regular programming-related content.</p>
<p>You can follow me on <a target="_blank" href="https://github.com/FahimFBA">GitHub</a> as well if you are interested in open source. Make sure to check <a target="_blank" href="https://fahimbinamin.com/">my website</a> as well.</p>
<p>Thank you so much! 😀</p>
 ]]>
                </content:encoded>
            </item>
        
    </channel>
</rss>
