Packages
This lesson is called Packages, part of the R in 3 Months (Fall 2021) course. This lesson is called Packages, part of the R in 3 Months (Fall 2021) course.
Transcript
Click on the transcript to go to that point in the video. Please note that transcripts are auto generated and may contain minor inaccuracies.
Loading transcript...
Note: If you get any messages from R about conflicts when loading packages, don't worry about them for now.
Your Turn
Working in the console, install the Tidyverse package using the code install.packages("tidyverse")
Check in the Packages tab on the bottom right panel to confirm that the tidyverse package has been installed successfully.
Learn More
There are thousands and thousands of R packages. What this means is that, if you ever wonder, can I do that in R, the answer is probably yes!
Have any questions? Put them below and we will help you out!
Course Content
134 Lessons
You need to be signed-in to comment on this post. Login.
S. Revi Sterling • March 17, 2021
trying to install and load skimr and getting:
> skim(mtcars) Error in skim(mtcars) : could not find function "skim" > skim(mtcars) Error in skim(mtcars) : could not find function "skim"
Kathleen Carson • March 18, 2021
I have some Conflicts with Tidyverse. Do I need to worry about these? How do I resolve them?
-- Conflicts --------------------------------------------------------------------------------------------------- tidyverse_conflicts() -- x dplyr::filter() masks stats::filter() x dplyr::lag() masks stats::lag()
Harold Stanislaw • March 18, 2021
Should we occasionally check for package updates?
Kateryn Pino • March 29, 2021
Hi David, I have two warning messages installing the packages:
-- Conflicts --------------------------------------------- tidyverse_conflicts() -- x dplyr::filter() masks stats::filter() x dplyr::lag() masks stats::lag() Warning message: package ‘tidyverse’ was built under R version 4.0.4 > library(skimr) Warning message: package ‘skimr’ was built under R version 4.0.4
Let me know what is that means and if I can continue despite them. Thanks!
Lauren Nitecki • June 18, 2021
When I run the library command, I get the following error message, any suggestions on how to resolve this issues? library(tidyverse) Error: package or namespace load failed for ‘tidyverse’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]): namespace ‘ellipsis’ 0.3.1 is already loaded, but >= 0.3.2 is required In addition: Warning message: package ‘tidyverse’ was built under R version 4.0.5
TIna Thomas • June 25, 2021
Hi David,
Here is the error I am getting:
> skim(mtcars) Error in skim(mtcars) : could not find function "skim" > library(skimr) Error in library(skimr) : there is no package called ‘skimr’
Thanks for advising.
Will Donnelly • August 6, 2021
I'm having trouble with opening the exercises.R file. The script keeps informing me that "this version of R is unavailable on your cpu. You need to download r.tools." In particular, I get this: WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
https://cran.rstudio.com/bin/windows/Rtools/ Installing package into ‘C:/Users/Owner/OneDrive - Loyola University Chicago/Documents/R/win-library/4.1’ (as ‘lib’ is unspecified) How can I get around this?
Lisa Laughlin • September 10, 2021
When I try to install the packages it tells me I need Rtools. > install.packages("tidyverse") WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
https://cran.rstudio.com/bin/windows/Rtools/ trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.1/tidyverse_1.3.1.zip' Content type 'application/zip' length 430255 bytes (420 KB) downloaded 420 KB
When I try to install Rtools I get this > install.packages("Rtools") WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
https://cran.rstudio.com/bin/windows/Rtools/ Warning in install.packages : package ‘Rtools’ is not available for this version of R
A version of this package for your version of R might be available elsewhere, see the ideas at https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
Manav Jain • September 11, 2021
I got this error while installing tidyverse pkg ERROR: dependencies ‘googledrive’, ‘googlesheets4’, ‘httr’, ‘rvest’, ‘xml2’ are not available for package ‘tidyverse’. How to resolve?
Israel Johnson • September 16, 2021
After I attempt to execute the library command for skimr I am not getting anything. The package successfully unpacked so it was no problem with that. Why is this happening?
Kathleen Griesbach • September 17, 2021
Hello, posting the question from the live session here as we discussed. I was able to install both packages, but when I tried to load the skimr package I got this error message. Thanks in advance!
> library(skimr) Error: package or namespace load failed for ‘skimr’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]): there is no package called ‘xfun’
Or Oron • September 19, 2021
Can I press "Run" whilst it is running? Do I need to press "Run" after every line, or can I install it together?
Lindsay Quarles • September 22, 2021
Is there anyway to get a list of the packages you already have installed?
Maggie Taylor • November 19, 2021
I'm having trouble loading tidyverse after install. I get the following error: Error: package or namespace load failed for ‘tidyverse’ in namespaceExport(ns, exports): undefined exports: format_tagged_na, is.labelled, is_tagged_na, labelled, labelled_spss, na_tag, print_labels, print_tagged_na, read_dta, read_por, read_sas, read_sav, read_spss, read_stata, read_xpt, tagged_na, vec_arith.haven_labelled, write_dta, write_sas, write_sav, write_xpt, zap_empty, zap_formats, zap_label, zap_labels, zap_missing, zap_widths In addition: Warning message: S3 methods ‘names<-.haven_labelled’, ‘as.character.haven_labelled’, ‘as_factor.data.frame’, ‘as_factor.haven_labelled’, ‘as_factor.labelled’, ‘format.haven_labelled’, ‘format.pillar_shaft_haven_labelled_chr’, ‘format.pillar_shaft_haven_labelled_num’, ‘is.na.haven_labelled_spss’, ‘levels.haven_labelled’, ‘median.haven_labelled’, ‘obj_print_footer.haven_labelled’, ‘obj_print_footer.haven_labelled_spss’, ‘obj_print_header.haven_labelled’, ‘quantile.haven_labelled’, ‘summary.haven_labelled’, ‘vec_arith.haven_labelled’, ‘vec_arith.haven_labelled.default’, ‘vec_arith.haven_labelled.haven_labelled’, ‘vec_arith.haven_labelled.numeric’, ‘vec_arith.numeric.haven_labelled’, ‘vec_cast.character.haven_labelled’, ‘vec_cast.character.haven_labelled_spss’, ‘vec_cast.double.haven_labelled’, ‘vec_cast.double.haven_labelled_spss’, ‘vec_cast.haven_labelled.character’, ‘vec_cast.haven_labelled.double’, ‘vec_cast.haven_labelled.haven_labelled’, ‘vec_cast.haven_labelled.haven_labelled_spss’, ‘vec_cast.haven_ [... truncated]
Any suggestions?
LILIANA CUBAS GAONA • January 14, 2022
Hi, when I run library (Tidyverse), I got: > library(tidyverse) -- Attaching packages -------------------------------------------------------------------------------- tidyverse 1.3.1 -- v ggplot2 3.3.5 v purrr 0.3.4 v tibble 3.1.6 v dplyr 1.0.7 v tidyr 1.1.4 v stringr 1.4.0 v readr 2.1.1 v forcats 0.5.1 -- Conflicts ----------------------------------------------------------------------------------- tidyverse_conflicts() -- x dplyr::filter() masks stats::filter() x dplyr::lag() masks stats::lag()
will I have problems with these conflicts? Many thanks in advance for your help
Cameron Cross • January 15, 2022
Hi. I get the following error:
Error in read_csv("data/faketucky.csv") : could not find function "read_csv"
I went in and installed ellipsis, vctrs and Rcpp. Any ideas? Thanks!
Caitlin Webb • February 9, 2022
Hi David,
When I tried to run tidyverse I get the following message: Error: package or namespace load failed for ‘tidyverse’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]): there is no package called ‘dplyr’
I then ran install.package("dplyr") and got the following error:
installing the source package ‘dplyr’
trying URL 'https://cran.rstudio.com/src/contrib/dplyr_1.0.8.tar.gz' Content type 'application/x-gzip' length 880713 bytes (860 KB)
downloaded 860 KB
The downloaded source packages are in /private/var/folders/ty/l38ympg13j16pp4l5d3y8bc40000gn/T/Rtmp3ijuq4/downloaded_packages’
How should I go about rectifying this? Thanks!
jeph mathias • March 23, 2022
Thanks, that worked but got conflict messages on tidy verse. Didn't worry for now.
Gloria Li • May 13, 2022
Hi! Thanks for sharing this. I got this when I was trying to load skimr
library(skimr) Error in library(skimr) : there is no package called ‘skimr’
Sarah Quackenbush • July 8, 2022
Hi, I've looked through all the previous comments and I don't seem to see my exact one here
With install.packages("tidyverse") I get:
Error in loadNamespace(j = 3.3.0 is required Calls: ... namespaceImportFrom -> asNamespace -> loadNamespace Execution halted ERROR: lazy loading failed for package 'dbplyr'
Then with > library(tidyverse) I get Error: package or namespace load failed for ‘tidyverse’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]): there is no package called ‘dbplyr’ In addition: Warning message: package ‘tidyverse’ was built under R version 4.0.5
I tried install.package("dbplyr") as that seemed to be what helped other people here, but all that I got there was
Error in loadNamespace(j = 3.3.0 is required Calls: ... namespaceImportFrom -> asNamespace -> loadNamespace Execution halted ERROR: lazy loading failed for package 'dbplyr'
Any ideas?
Brooke Callaghan • July 12, 2022
> library(tidyverse) Error: package or namespace load failed for ‘tidyverse’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]): there is no package called ‘stringi’
Getting this error message. Please advise, thank you!
NIKHIL RATNA • July 19, 2022
I have a couple of naive queries
Tatiana Bustos • July 21, 2022
I have some conflicts in my loaded packages. Can you explain what they mean? Pasting the console output below:
library(skimr) > library(tidyverse) ── Attaching packages ──────────────────────────────────────── tidyverse 1.3.2 ── ✔ ggplot2 3.3.6 ✔ purrr 0.3.4 ✔ tibble 3.1.7 ✔ dplyr 1.0.9 ✔ tidyr 1.2.0 ✔ stringr 1.4.0 ✔ readr 2.1.2 ✔ forcats 0.5.1 ── Conflicts ─────────────────────────────────────────── tidyverse_conflicts() ── ✖ dplyr::filter() masks stats::filter() ✖ dplyr::lag() masks stats::lag() > library(skimr) >
Sarah Quackenbush • July 29, 2022
Hi Charlie and David,
I apologise, I can't seem to reply to our thread. Thank you so much for your input on my previous messages! I checked the packages and they still were not installed. I decided to start from the beginning: uninstalled everything, reinstalled and started the course from the start. And it worked! I must have done something wrong first time round, but all fixed now. Thanks again for all your help!
Sarah
Shannon Peery • August 30, 2022
I am unable to load the library for tidyverse or skimr. I am in the exercises.r file working with the project. I have placed the correct syntax for installing the packages (not sure if it worked) and continue to get an "Error in library (skimr) : there is no package called 'skimr'" in the console box after trying to run it - using the run button. What might be the problem?
Julieth Silao • September 13, 2022
skimr can not downloaded due to invailability
Ellen Minzner • January 24, 2023
I believe I have both tidyverse and skimr installed, but got this message when trying to load them:
Error: package or namespace load failed for ‘tidyverse’ in loadNamespace(j library(skimr) Error: package or namespace load failed for ‘skimr’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]): there is no package called ‘utf8’
Kathy Dowell • February 16, 2023
When loading tidyverse, I get this message. Do I need to do anything to address this? > library(tidyverse) ── Attaching packages ──────────────────────────────────────────────────────────────────────────────────────────── tidyverse 1.3.2 ── ✔ ggplot2 3.4.1 ✔ purrr 1.0.1 ✔ tibble 3.1.8 ✔ dplyr 1.1.0 ✔ tidyr 1.3.0 ✔ stringr 1.5.0 ✔ readr 2.1.4 ✔ forcats 1.0.0 ── Conflicts ─────────────────────────────────────────────────────────────────────────────────────────────── tidyverse_conflicts() ── ✖ dplyr::filter() masks stats::filter() ✖ dplyr::lag() masks stats::lag()
Andrew Paquin • March 13, 2023
Hi. I keep getting the following message in red: WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
https://cran.rstudio.com/bin/windows/Rtools/
The thing is, I installed Rtools yesterday as part of one of the earlier lessons. Perhaps I biffed it? Is there a way for me to check the status of my Rtools installation?
Melissa Mullins • March 16, 2023
I've gotten this message (in red) several times but it hasn't impacted my ability to do stuff (yet). I know you said windows users "might" have to download R tools. Should I do that or does it matter? WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
Kiana Robinson • March 22, 2023
I'm getting an error with the following code:
> library(tidyverse) Error: package or namespace load failed for ‘tidyverse’: .onAttach failed in attachNamespace() for 'tidyverse', details: call: NULL error: package or namespace load failed for ‘ggplot2’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]): namespace ‘rlang’ 1.0.4 is already loaded, but >= 1.1.0 is required
Mercy Abarike • March 26, 2023
I installed the tidyverse and skimr packages sucessfully. i tried loading them using library(tidyverse) and library(skimr) and this is what I get. library(tidyverse) ── Attaching core tidyverse packages ─────────────── tidyverse 2.0.0 ── ✔ dplyr 1.1.0 ✔ readr 2.1.4 ✔ forcats 1.0.0 ✔ stringr 1.5.0 ✔ ggplot2 3.4.1 ✔ tibble 3.2.0 ✔ lubridate 1.9.2 ✔ tidyr 1.3.0 ✔ purrr 1.0.1
── Conflicts ───────────────────────────────── tidyverse_conflicts() ── ✖ dplyr::filter() masks stats::filter() ✖ dplyr::lag() masks stats::lag() ℹ Use the conflicted package to force all conflicts to become errors > library(skimr) Please what shoul i do
David Keyes Coach • June 13, 2023
Here's a quick video explanation!