Skip to content
Home » The swirl R package

The swirl R package

    The swirl R package will teach you R programming and data science interactively. In this article, you will learn to install swirl package in your R installation.

    Step 1:

    This step assume that you have R and R Studio installed as per the previous article. Open the R Studio console and type the following line next to > symbol.

     > install.packages("swirl")

    See the figure below.

    Install Swirl Packages
    Install Swirl Packages

    Make sure that your internet connection is working before running the command. The swirl packages will be downloaded and extracted successfully. After installation your screen should look like the following.

    The swirl packages are downloaded and extracted in local temp directory
    The swirl packages are downloaded and extracted in local temp directory

    Step 2:

    To start using the swirl packages use the library() function and this step must be repeated every time you want to use swirl.

    Type the following command in the R Studio console and press enter after each line.

    > library("swirl")
    > swirl()

    The above code will install swirl courses for you and get you started with R programming.

    load swirl using the library function
    load swirl using the library function and type swirl() to load the courses.

    Here is the list courses displayed for you by swirl. Note that you can install other courses also. To get started with swirl make your selection and start learning.

    List of courses available for you
    List of courses available for you

    Type ?installCourses to get the list of functions that could help you install new courses.

    In this tutorial, you have two option to learn R programming. Either use swirl to guide you through the learning process or use this tutorial to learn R.

    With swirl to guide you through the learning process, you need to load swirl each time.

    This tutorial gives you freedom to learn and practice R directly on the R studio console.