In these lessons, you will learn how to download and install packages from CRAN and GitHub, and the differences between the two.
In these lessons, you will learn how to download and install packages from CRAN and GitHub, and the differences between the two. You will learn why these resources are essential as you begin your journey in R programming. You will also learn how to use external package functions for data manipulation, specifically the popular package dplyr. This powerful package will greatly expand your ability to take full control over your data and gain signifnicant results for a wide variety of use-cases.
We will also introduce you to tidyr's pivot functions, such as pivot_wider() and unnest functions like separate_rows(). These are powerful tools for data manipulation and will help you to organize your data more effectively. By the end of these lessons, you will have a comprehensive understanding of how to use external packages in R and should be able to effectively manipulate and organize data using external functions.
Learning Objectives:
- Discover how to download and install packages from CRAN and GitHub
- Learn how to use external package functions for data manipulation with dplyr()
- Understand the pivot functions and unnest function, separate_rows() in tidyr
- Explain how to apply pivot functions and unnest function, separate_rows() to organize data
Skills you’ll gain
Knitr PackageR (Programming Language)RStudioStatistical PackagesTidyrWhat You'll Learn
- Download and install R packages from CRAN and GitHub, and distinguish between the two sources
- Use external package functions for data manipulation with the dplyr package
- Apply tidyr's pivot functions such as pivot_wider() to reshape data
- Use unnest functions like separate_rows() in tidyr to organize data
- Manipulate and organize data effectively using external package functions in R
Key Takeaways
- CRAN and GitHub are essential resources for downloading and installing packages as you begin R programming.
- The dplyr package expands your ability to take full control over your data across a wide variety of use-cases.
- tidyr provides pivot functions such as pivot_wider() and unnest functions such as separate_rows() for reshaping data.
- By the end of the lessons you will have a comprehensive understanding of how to use external packages in R.
- External package functions allow you to manipulate and organize data more effectively.
Frequently Asked Questions
What does this course cover?
It covers how to download and install packages from CRAN and GitHub, the differences between the two, using external package functions for data manipulation with dplyr, and using tidyr's pivot functions such as pivot_wider() and unnest functions such as separate_rows().
Who is this course for?
It is for those beginning their journey in R programming who want to use external packages to manipulate and organize data.
What skills will I gain?
You will gain skills in R (Programming Language), RStudio, Tidyr, the Knitr Package, and statistical packages, and be able to effectively manipulate and organize data using external functions.
What packages are taught in this course?
The course focuses on dplyr for data manipulation and tidyr for reshaping data with pivot functions like pivot_wider() and unnest functions like separate_rows().
What topics do the lessons include?
Lessons include installing packages from CRAN and from GitHub, working with external package functions, an introduction to dplyr in two parts, and an introduction to tidyr.
Transcript
Show transcript (free preview lesson)
Transcript of the free preview lesson. Remaining lessons unlock with the full course.
Hello, my name is David Christensen, and in these lessons, you will learn how to install and use packages in R. In this lesson, I will show you how to install packages from the Comprehensive R Archive Network, or CRAN. R is a highly extensible language, with many packages already created to handle just about any data situation you can imagine. We've primarily been working with the base R functions, but now we can really start to do some interesting things with packages. Before we can use a package, we need to install it. Virtually all packages you install will come from the Comprehensive R Archive Network, or CRAN. You can see all of the available packages by visiting cran .rproject .org, then clicking on Available Packages, and then clicking Table of Available Packages. This will show you all of the packages available within CRAN. We are going to demonstrate installing a few popular packages. If you'd like to see a list of other popular packages, try searching a web browser for top R packages. To install a package from CRAN, we can use the function InstallPackages. So I'll type InstallPackages, and between the parentheses, we need to type the name of the package we want to install. Let's install the package dplyr. dplyr is a user -friendly, highly popular package for data manipulation. Let's run the function to install dplyr. Notice that when we run the function, we get a warning that says rtools is required to build R packages, but is not currently installed. It's possible to install packages without rtools. However, if we want to build them on our machine, we need to install the rtools software first. Let's go ahead and install rtools on this machine. To install rtools, we'll head back to cran .rproject .org. The specific address on the rproject website is forward slash bin, forward slash windows, forward slash rtools. I'll then click on the version of rtools that is appropriate for my R installation. For me, this is rtools 4 .2. So I'll click rtools 4 .2. Then I'll click the rtools 4 .2 installer to begin the download. Once the download is complete, you can open the installer. I'm going to accept the default installation location and default settings. I'll wait for the installation to complete. Once the installation is complete, you can delete the installer file. Let's head back to RStudio and try downloading another package. This time, I'll install the tidyr package. So we'll start with the function, install packages. And between the parentheses, I'll put tidyr. Great, the tidyr package is now installed. Notice this time we did not get an error indicating that we needed rtools. If for some reason we need to remove a package, we can use the remove packages function, placing the name of the package between the parentheses. Thanks for watching. Stay tuned for the next video where I'll show you how to install packages from GitHub.
Learn on the Go
Take your learning anywhere — the KnowledgeCity mobile app lets you watch lessons on the go.